/midnight-cq:quality-checkfrom midnight-cq
Runs and interprets quality checks for Midnight projects: Biome linting, tsc type checks, Compact contract compilation, Vitest unit tests, and Playwright E2E tests. Helps debug failures and run the full pre-push suite.
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 —
compact compileCLI usage and package names/versions checked against the installed toolchain (compiler 0.31.1) + npm (@openzeppelin/[email protected], runtime 0.16.0).
This skill is for running checks and fixing failures. To set up quality tooling from scratch, use
midnight-cq:quality-init.
| Check | Command | Scope |
|---|---|---|
| Lint + format (changed) | biome ci --changed | Files changed vs default branch |
| Lint + format (all) | biome ci | Entire project |
| Lint + format (fix) | biome check --write | Auto-fix |
| Type check | tsc --noEmit | All TS files |
| Contract compile | compact compile --skip-zk | All .compact files |
| Unit/contract tests | vitest run | All test suites |
| E2E tests | npx playwright test | DApp browser tests |
| Full pre-push suite | biome ci && tsc --noEmit && vitest run | Everything |
Run commands from the project root. If biome is not on the path, prefix with npx.
Each violation uses this format:
path/to/file.ts:line:col rule/name LEVEL description
Example:
src/index.ts:12:5 style/useConst ERROR This variable is never reassigned.
rule/name — maps directly to a rule at biomejs.dev/linter/rules/<rule-name>. Open the URL for the rationale and suggested fix.LEVEL is always ERROR in Midnight projects (no warnings in CI — see biome.json).format as the rule and show a unified diff of what Biome expects. Apply with biome check --write.Each error uses this format:
path/to/file.ts(line,col): error TS#### description
In Midnight projects, tsc errors frequently originate from:
managed/ are regenerated by compact compile. If .compact source changed but managed/ was not recompiled, tsc will report phantom type errors. Fix: run compact compile --skip-zk first, then re-run tsc --noEmit.managed/ — the compiler emits named exports; check the generated .d.ts for the exact export name.A failing test shows:
FAIL src/test/MyContract.test.ts
● transferOwnership › should fail when called by unauthorized
Error: Ownable: caller is not the owner
at ProxyHandler.<anonymous> (node_modules/@openzeppelin/compact-simulator/dist/...)
at ...
at MyContractSimulator.transferOwnership (src/test/simulators/MyContractSimulator.ts:42:5)
at Object.<anonymous> (src/test/MyContract.test.ts:67:7)
Reading the trace:
assert string in the .compact source. Search the contract for the literal message to find the failing assertion.expect(...) or method call that failed.ProxyHandler frames in node_modules — they are internal simulator machinery and carry no debugging signal.Received function did not throw. Check whether the circuit path that should reject was actually reached.| Symptom | Fix |
|---|---|
| Biome format violations across many files | npx biome check --write — rewrites all auto-fixable issues in one pass |
tsc errors about types in managed/ | compact compile --skip-zk && npx tsc --noEmit — recompile contracts first |
vitest test throws unexpected error string | Search the .compact source for the error message; the assertion path diverged — update the test or the contract |
biome ci --changed passes locally but CI fails | CI runs biome ci (all files); run npx biome ci locally to reproduce |
| Playwright tests time out on wallet/transaction steps | Increase timeout in playwright.config.ts for blockchain-heavy operations; default 30 s is too short for proof generation |
midnight-cq:quality-initmidnight-cq:compact-testingmidnight-cq:dapp-testing| Topic | Reference |
|---|---|
| Each Biome rule explained with fix guidance | references/biome-diagnostics.md |
| Common simulator errors and how to fix them | references/test-failures.md |
| CI-specific debugging guide | references/ci-troubleshooting.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./dapp-testingmidnight-cq:dapp-testingThis skill should be used when the user asks to test my dapp, write e2e tests, test wallet connection, playwright midnight, test transaction UI, integration test frontend, end-to-end test, browser test, test UI with contract, write Playwright tests for a Midnight dapp, mock ContractProvider, test wallet disconnect, test confirmation screen, test rejected transaction, test contract state displayed in the UI, test React components with contract simulator, mock wallet in tests, or set up e2e testing. NOT for testing Compact contract logic in isolation — see midnight-cq:compact-testing./ledger-testingmidnight-cq:ledger-testingThis skill should be used when the user asks to write ledger tests, test transaction construction, test proof staging, test ZswapLocalState, test DustLocalState, test cost model, test coinCommitment, test ledger-v8, test onchain-runtime, or test well-formedness. Also triggered by requests to write tests for code that uses @midnight-ntwrk/ledger-v8 or @midnight-ntwrk/onchain-runtime directly, test proof staging lifecycle, test token type functions, test crypto fixtures, test serialization round-trips for ledger types, test fee estimation, test SyntheticCost, or test coinNullifier./quality-initmidnight-cq:quality-initThis skill should be used when the user asks to set up linting, add code quality tooling, configure biome, init project quality, initialize code quality, add CI workflows, add GitHub Actions, set up git hooks, add pre-commit hooks, add testing, add Vitest, add Playwright, or configure formatter for a Midnight Network project./wallet-testingmidnight-cq:wallet-testingThis skill should be used when the user asks to write wallet tests, test my wallet variant, test my capability, test my wallet service, test WalletBuilder, write wallet SDK tests, test Effect code, test Observable state, mock wallet services, test wallet state management, wallet test fixtures, wallet test setup, or Vitest wallet. Also triggered by requests to write tests for custom wallet implementations or compose wallets with WalletBuilder.Other plugins' skills for the same job