/midnight-cq:quality-initfrom midnight-cq
Guides through setting up code quality tooling for Midnight Network projects: detects project type, migrates from ESLint/Prettier to Biome, scaffolds Vitest for Compact contracts and Playwright for frontend DApps, and configures GitHub Actions.
Ships in midnight-cq. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Last verified: 2026-09-17 — scaffolded dependency names/versions checked against npm (
@openzeppelin/[email protected]); compiler installed via thecompacttoolchain, not npm.
Hard rule: Biome exclusively. Never install ESLint or Prettier alongside Biome. If either already exists in the project, migrate and remove them before scaffolding anything else.
This skill guides you through setting up all code quality tooling for a Midnight Network project. Follow the 3-step flow below in order: detect the project type, handle any conflicting tools, then scaffold the appropriate configuration.
Scan the project root to determine what kind of project this is. Detection is not mutually exclusive — a project can be both a Compact project and a frontend DApp.
| Signal | Meaning |
|---|---|
Any .compact file exists | Compact contract project → add Vitest with simulator |
package.json contains react, next, vue, or svelte dep | Frontend / DApp → add Playwright E2E |
.eslintrc.* or .prettierrc.* (any extension) exists | Conflict detected → migrate before scaffolding |
biome.json already exists | Partial setup → extend rather than overwrite |
Check all signals before proceeding. Record findings; they drive Step 3.
If .eslintrc.* or .prettierrc.* files are present, migrate them before creating any new config.
ESLint migration:
npx @biomejs/biome migrate eslint --write --include-inspired
Prettier migration:
npx @biomejs/biome migrate prettier --write
After migration, remove:
eslint, @typescript-eslint/*, eslint-plugin-*, eslint-config-*prettier, prettier-plugin-*.eslintrc.*, .eslintignore, .prettierrc.*, .prettierignoreeslint or prettier from package.jsonMigration limitations — review manually after running:
| Limitation | Action |
|---|---|
YAML config files (.eslintrc.yaml, .eslintrc.yml) | Migrate by hand; the CLI does not parse YAML |
| ESLint rule option gaps | Some rules have no Biome equivalent — log them and close the gap with code review |
eslint-disable comments | Convert to biome-ignore or remove if the rule no longer applies |
Prettier overrides per file glob | Reproduce in biome.json overrides array manually |
If no conflicts are found, skip to Step 3.
Always scaffold the following regardless of project type:
| Tool | Purpose |
|---|---|
biome.json | Linting, formatting, and import sorting — single source of truth |
.editorconfig | Cross-editor baseline (indent size, line endings, charset) |
Husky + pre-commit hook | Fast check on staged files: biome ci --changed |
Husky + pre-push hook | Full check: biome ci && tsc --noEmit && vitest run |
.github/workflows/checks.yml | CI — Biome only, runs on every push and PR |
.github/workflows/test.yml | CI — compile + typecheck + tests, runs on PR and main |
Scaffold conditionally based on detection:
| Condition | Additional Scaffolding |
|---|---|
.compact file detected | Vitest + @openzeppelin/compact-simulator for contract unit tests |
| Frontend / DApp detected | Playwright (headless only — never interactive) for E2E tests |
Use the OpenZeppelin compact-contracts biome.json as the reference implementation. Key settings:
vcs.enabled: true, vcs.clientKind: "git", vcs.useIgnoreFile: true)"error" level — warnings are not actionable in CImanaged/ (Compact compiler output), dist/, node_modules/, coverage/See references/biome-config.md for the full annotated biome.json template.
# Install
npm install --save-dev husky
npx husky init
# .husky/pre-commit — fast staged-file check
npx biome ci --changed
# .husky/pre-push — full suite
npx biome ci && npx tsc --noEmit && npx vitest run
The pre-commit hook uses --changed to check only staged files, keeping it under 2 seconds on most projects. The pre-push hook runs the full suite to prevent broken code from reaching the remote.
Two workflows keep CI fast and targeted:
checks.yml — fast, runs on every push and pull_request:
biome citest.yml — thorough, runs on pull_request and push to main:
compact compile (if Compact project) → tsc --noEmit → vitest runSee references/ci-workflows.md for the full YAML for both workflows.
midnight-cq:quality-checkmidnight-cq:compact-testingmidnight-cq:dapp-testingmidnight-tooling:troubleshooting| Topic | Reference |
|---|---|
Annotated biome.json template with all rule settings, .editorconfig, migration procedure | references/biome-config.md |
Vitest config, globalSetup for Compact compilation, simulator dependency setup | references/vitest-config.md |
| Playwright config (always headless), browser setup, timeouts for blockchain ops | references/playwright-config.md |
| Husky setup, pre-commit and pre-push hook scripts | references/husky-hooks.md |
Full CI workflow YAML for checks.yml and test.yml, path filtering | references/ci-workflows.md |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub midnightntwrk/midnight-expert --plugin midnight-cq7 skills in this plugin
/compact-testingmidnight-cq:compact-testingThis skill should be used when the user asks to write Compact contract tests, test a contract with the simulator, set up createSimulator, mock contract patterns, override witnesses in tests, write unit tests for Compact circuits, set up Vitest for a Compact project, test access control or error cases, use describe.each or it.each for parameterized tests, check invariants with afterEach, property-based testing with fast-check, or ZK commitment testing./dapp-connector-testingmidnight-cq:dapp-connector-testingThis skill should be used when the user asks to test DApp Connector API integration, test wallet connection, test makeTransfer, test balanceTransaction, test submitTransaction, mock ConnectedAPI, stub wallet for tests, test wallet errors, test PermissionRejected, test Disconnected handling, test progressive enhancement, write wallet integration tests, test DApp Connector error codes, test wallet discovery, test window.midnight, test apiVersion, test signData, or test DApp Connector security.Other plugins' skills for the same job