From f3602b137132485cee55075d7291d8fb566c92f9 Mon Sep 17 00:00:00 2001 From: jackkav Date: Tue, 26 May 2026 09:19:20 +0200 Subject: [PATCH 1/3] chore: add quick-check skill and reference it in AGENTS.md Adds the quick-check Claude Code skill that selects the narrowest lint/type-check/test command for the affected workspace, and documents it in AGENTS.md alongside the existing validation commands. Co-Authored-By: Claude Sonnet 4.6 --- .claude/skills/quick-check/SKILL.md | 131 ++++++++++++++++++++++++++++ AGENTS.md | 2 + 2 files changed, 133 insertions(+) create mode 100644 .claude/skills/quick-check/SKILL.md diff --git a/.claude/skills/quick-check/SKILL.md b/.claude/skills/quick-check/SKILL.md new file mode 100644 index 000000000000..efddec510447 --- /dev/null +++ b/.claude/skills/quick-check/SKILL.md @@ -0,0 +1,131 @@ +--- +name: quick-check +description: "Run the smallest useful format, lint, type-check, or test command for the affected Insomnia workspace, and only escalate to broader validation when the change scope justifies it." +argument-hint: "Provide changed file paths and the desired check type (format, lint, type-check, test), or name the target workspace and what you want validated" +--- + +# Quick Workspace Checks + +## When to Use + +- You are iterating on a change and want the fastest useful validation loop. +- The change is limited to one workspace or a small set of files. +- You do not want repo-wide checks yet. + +## Core Rule + +Choose the smallest affected workspace first. Only expand to more workspaces or repo-wide checks when the change crosses boundaries. + +## Workspace Mapping + +| Changed paths | Workspace | Quick checks | +| -------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `packages/insomnia/**` | `insomnia` | `npm run lint -w insomnia`, `npm run type-check -w insomnia`, `npm test -w insomnia` | +| `packages/insomnia-api/**` | `insomnia-api` | `npm run lint -w insomnia-api`, `npm run type-check -w insomnia-api` | +| `packages/insomnia-inso/**` | `insomnia-inso` | `npm run lint -w insomnia-inso`, `npm run type-check -w insomnia-inso`, `npm run test:unit -w insomnia-inso` | +| `packages/insomnia-testing/**` | `insomnia-testing` | `npm run lint -w insomnia-testing`, `npm run type-check -w insomnia-testing`, `npm test -w insomnia-testing` | +| `packages/insomnia-scripting-environment/**` | `insomnia-scripting-environment` | `npm run lint -w insomnia-scripting-environment`, `npm run type-check -w insomnia-scripting-environment`, `npm test -w insomnia-scripting-environment` | +| `packages/insomnia-smoke-test/**` | `insomnia-smoke-test` | `npm run lint -w insomnia-smoke-test`, `npm run test:dev -w insomnia-smoke-test -- --project=Smoke ` | + +## Check Types + +- `format` + ```bash + npx prettier --write + ``` +- `lint` + Run prettier, then eslint --fix, then verify: + ```bash + npx prettier --write + npx eslint --fix + npm run lint -w + ``` +- `type-check` + ```bash + npm run type-check -w + ``` +- `test` + Use the workspace test command or the narrowest file-specific test you can. + +## Targeted Test Shortcuts + +- App: + ```bash + npm test -w insomnia -- --run src//.test.ts + ``` +- Testing: + ```bash + npm test -w insomnia-testing -- --run src//.test.ts + ``` +- Scripting environment: + ```bash + npm test -w insomnia-scripting-environment -- --run src//.test.ts + ``` +- CLI: + ```bash + npm run test:unit -w insomnia-inso + ``` +- Smoke: + ```bash + npm run test:dev -w insomnia-smoke-test -- --project=Smoke tests/smoke/.test.ts + ``` + +## App E2E Near Push + +Prefer the fastest path first. + +### Fast dev-runtime path + +Run these in separate terminals: + +- Terminal 1: + ```bash + npm run dev + ``` + or + ```bash + npm run watch:app + ``` +- Terminal 2: + ```bash + npm run test:dev -w insomnia-smoke-test -- --project=Smoke tests/smoke/.test.ts + ``` + +### Built-app path + +Use this when Vite config changed, when you need build-mode confidence, or when the failure only reproduces in the built app. + +Run these as separate steps, preferably in separate terminals: + +- Terminal 1: + ```bash + npm run app-build + ``` +- Terminal 2: + ```bash + npm run test:build -w insomnia-smoke-test -- --project=Smoke tests/smoke/.test.ts + ``` + +## Escalate Scope When + +- You changed more than one workspace. +- You changed root config or shared tooling such as `package.json`, `package-lock.json`, or `eslint.config.mjs`. +- You changed shared code paths used by multiple workspaces. +- You touched the renderer/main boundary. In that case consider: + ```bash + npm run check:renderer-node-imports -w insomnia + ``` + +If the scope is broad enough, use the repo-wide commands: + +```bash +npm run lint +npm run type-check +npm test +``` + +## Notes + +- In VS Code, format-on-save runs Prettier (`esbenp.prettier-vscode`) then ESLint autofix (`source.fixAll.eslint`) in that order. The lint check type above replicates this. +- `insomnia-smoke-test` has no `type-check` script. +- `insomnia-inso` has no generic `test` script; prefer `test:unit` for quick checks. diff --git a/AGENTS.md b/AGENTS.md index 18246fa077cf..251bccc5929a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,6 +33,8 @@ npm run type-check # TypeScript check all workspaces npm test # Tests all workspaces (or: npm test -w packages/insomnia) ``` +For faster, scope-limited validation during iteration, use the `/quick-check` skill (`.claude/skills/quick-check/SKILL.md`). It selects the narrowest lint/type-check/test command for the affected workspace and only escalates to repo-wide checks when necessary. + ## Repository Structure `packages/` `insomnia/` ← Main Electron app From 74ca695f2b5a34ae82defed93c51b1c5215105c2 Mon Sep 17 00:00:00 2001 From: jackkav Date: Tue, 26 May 2026 09:22:12 +0200 Subject: [PATCH 2/3] chore: clarify quick-check should be run before pushing Co-Authored-By: Claude Sonnet 4.6 --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 251bccc5929a..f588957bd3c8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,7 +33,7 @@ npm run type-check # TypeScript check all workspaces npm test # Tests all workspaces (or: npm test -w packages/insomnia) ``` -For faster, scope-limited validation during iteration, use the `/quick-check` skill (`.claude/skills/quick-check/SKILL.md`). It selects the narrowest lint/type-check/test command for the affected workspace and only escalates to repo-wide checks when necessary. +Before pushing, run `/quick-check` (`.claude/skills/quick-check/SKILL.md`) to validate your changes. It selects the narrowest lint/type-check/test command for the affected workspace, so it's fast enough to run every time — only escalating to repo-wide checks when the change crosses workspace boundaries. ## Repository Structure `packages/` From 7b9302200740300c6ee0ece575fadeaf89854897 Mon Sep 17 00:00:00 2001 From: jackkav Date: Tue, 26 May 2026 09:28:54 +0200 Subject: [PATCH 3/3] chore: simplify quick-check skill, remove clutter and repetition Co-Authored-By: Claude Sonnet 4.6 --- .claude/skills/quick-check/SKILL.md | 137 ++++++---------------------- 1 file changed, 30 insertions(+), 107 deletions(-) diff --git a/.claude/skills/quick-check/SKILL.md b/.claude/skills/quick-check/SKILL.md index efddec510447..b8f7da5e2bbf 100644 --- a/.claude/skills/quick-check/SKILL.md +++ b/.claude/skills/quick-check/SKILL.md @@ -4,128 +4,51 @@ description: "Run the smallest useful format, lint, type-check, or test command argument-hint: "Provide changed file paths and the desired check type (format, lint, type-check, test), or name the target workspace and what you want validated" --- -# Quick Workspace Checks - -## When to Use - -- You are iterating on a change and want the fastest useful validation loop. -- The change is limited to one workspace or a small set of files. -- You do not want repo-wide checks yet. - -## Core Rule - -Choose the smallest affected workspace first. Only expand to more workspaces or repo-wide checks when the change crosses boundaries. - ## Workspace Mapping -| Changed paths | Workspace | Quick checks | -| -------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `packages/insomnia/**` | `insomnia` | `npm run lint -w insomnia`, `npm run type-check -w insomnia`, `npm test -w insomnia` | -| `packages/insomnia-api/**` | `insomnia-api` | `npm run lint -w insomnia-api`, `npm run type-check -w insomnia-api` | -| `packages/insomnia-inso/**` | `insomnia-inso` | `npm run lint -w insomnia-inso`, `npm run type-check -w insomnia-inso`, `npm run test:unit -w insomnia-inso` | -| `packages/insomnia-testing/**` | `insomnia-testing` | `npm run lint -w insomnia-testing`, `npm run type-check -w insomnia-testing`, `npm test -w insomnia-testing` | +| Changed paths | Workspace | Commands | +| -------------------------------------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `packages/insomnia/**` | `insomnia` | `npm run lint -w insomnia`, `npm run type-check -w insomnia`, `npm test -w insomnia` | +| `packages/insomnia-api/**` | `insomnia-api` | `npm run lint -w insomnia-api`, `npm run type-check -w insomnia-api` | +| `packages/insomnia-inso/**` | `insomnia-inso` | `npm run lint -w insomnia-inso`, `npm run type-check -w insomnia-inso`, `npm run test:unit -w insomnia-inso` | +| `packages/insomnia-testing/**` | `insomnia-testing` | `npm run lint -w insomnia-testing`, `npm run type-check -w insomnia-testing`, `npm test -w insomnia-testing` | | `packages/insomnia-scripting-environment/**` | `insomnia-scripting-environment` | `npm run lint -w insomnia-scripting-environment`, `npm run type-check -w insomnia-scripting-environment`, `npm test -w insomnia-scripting-environment` | -| `packages/insomnia-smoke-test/**` | `insomnia-smoke-test` | `npm run lint -w insomnia-smoke-test`, `npm run test:dev -w insomnia-smoke-test -- --project=Smoke ` | - -## Check Types - -- `format` - ```bash - npx prettier --write - ``` -- `lint` - Run prettier, then eslint --fix, then verify: - ```bash - npx prettier --write - npx eslint --fix - npm run lint -w - ``` -- `type-check` - ```bash - npm run type-check -w - ``` -- `test` - Use the workspace test command or the narrowest file-specific test you can. - -## Targeted Test Shortcuts - -- App: - ```bash - npm test -w insomnia -- --run src//.test.ts - ``` -- Testing: - ```bash - npm test -w insomnia-testing -- --run src//.test.ts - ``` -- Scripting environment: - ```bash - npm test -w insomnia-scripting-environment -- --run src//.test.ts - ``` -- CLI: - ```bash - npm run test:unit -w insomnia-inso - ``` -- Smoke: - ```bash - npm run test:dev -w insomnia-smoke-test -- --project=Smoke tests/smoke/.test.ts - ``` +| `packages/insomnia-smoke-test/**` | `insomnia-smoke-test` | `npm run lint -w insomnia-smoke-test`, `npm run test:dev -w insomnia-smoke-test -- --project=Smoke ` | -## App E2E Near Push +`insomnia-smoke-test` has no `type-check` script. `insomnia-inso` has no generic `test` script. -Prefer the fastest path first. +## Lint -### Fast dev-runtime path +Format then fix then verify: -Run these in separate terminals: +```bash +npx prettier --write +npx eslint --fix +npm run lint -w +``` -- Terminal 1: - ```bash - npm run dev - ``` - or - ```bash - npm run watch:app - ``` -- Terminal 2: - ```bash - npm run test:dev -w insomnia-smoke-test -- --project=Smoke tests/smoke/.test.ts - ``` +## Targeted Tests -### Built-app path +Narrow to a single file using `--run`: -Use this when Vite config changed, when you need build-mode confidence, or when the failure only reproduces in the built app. +```bash +npm test -w -- --run src//.test.ts +``` -Run these as separate steps, preferably in separate terminals: +For smoke tests: -- Terminal 1: - ```bash - npm run app-build - ``` -- Terminal 2: - ```bash - npm run test:build -w insomnia-smoke-test -- --project=Smoke tests/smoke/.test.ts - ``` +```bash +npm run test:dev -w insomnia-smoke-test -- --project=Smoke tests/smoke/.test.ts +``` -## Escalate Scope When +To run smoke tests against the dev server, start `npm run dev` in a separate terminal first. Use `npm run app-build` + `npm run test:build` only when the failure requires a production build. -- You changed more than one workspace. -- You changed root config or shared tooling such as `package.json`, `package-lock.json`, or `eslint.config.mjs`. -- You changed shared code paths used by multiple workspaces. -- You touched the renderer/main boundary. In that case consider: - ```bash - npm run check:renderer-node-imports -w insomnia - ``` +## Escalate When -If the scope is broad enough, use the repo-wide commands: +- Change spans more than one workspace +- Root config changed (`package.json`, `package-lock.json`, `eslint.config.mjs`) +- Renderer/main boundary touched — also run `npm run check:renderer-node-imports -w insomnia` ```bash -npm run lint -npm run type-check -npm test +npm run lint && npm run type-check && npm test ``` - -## Notes - -- In VS Code, format-on-save runs Prettier (`esbenp.prettier-vscode`) then ESLint autofix (`source.fixAll.eslint`) in that order. The lint check type above replicates this. -- `insomnia-smoke-test` has no `type-check` script. -- `insomnia-inso` has no generic `test` script; prefer `test:unit` for quick checks.