Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions .claude/skills/quick-check/SKILL.md
Original file line number Diff line number Diff line change
@@ -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"
Comment on lines +2 to +4
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding allowed tools to the metadata for the commands it'll use. We can scope to specific commands not purely *. So, npx prettier * instead of npx * - docs

---

# 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, workspace seems not to be that useful since most changes also affect other workspaces. A full repo npm run lint && npm run type-check && npm test may be more accurate.


| 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 <optional file>` |

## Check Types

- `format`
```bash
npx prettier --write <changed files>
```
- `lint`
Run prettier, then eslint --fix, then verify:
```bash
npx prettier --write <changed files>
npx eslint --fix <changed files>
npm run lint -w <workspace>
```
- `type-check`
```bash
npm run type-check -w <workspace>
```
- `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/<path>/<file>.test.ts
```
- Testing:
```bash
npm test -w insomnia-testing -- --run src/<path>/<file>.test.ts
```
- Scripting environment:
```bash
npm test -w insomnia-scripting-environment -- --run src/<path>/<file>.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/<file>.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/<file>.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/<file>.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
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can give it an early exit condition section to prevent any spikes.

We could also have it not write everything to the terminal

  - eslint --quiet
  - npm test --silent
  - pipe commands with `| head -50 or 2>&1 | tail -25`

so only errors are shown to lower token usage even more.


## 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.
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ npm run type-check # TypeScript check all workspaces
npm test # Tests all workspaces (or: npm test -w packages/insomnia)
```

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/`
`insomnia/` ← Main Electron app
Expand Down
Loading