Help us improve
Share bugs, ideas, or general feedback.
From midnight-cq
This skill should be used when the user asks to run linting, check code quality, run tests, or needs help with "why is biome failing", "fix lint errors", "CI is failing", "type check errors", "biome error", "vitest failing", "tsc error", "playwright failing", or "e2e tests failing". Also triggered by requests to interpret Biome output, fix tsc errors in Midnight projects, debug vitest failures with simulator stack traces, run the full pre-push suite, or understand why compact compile is failing.
npx claudepluginhub devrelaicom/midnight-expert --plugin midnight-cqHow this skill is triggered — by the user, by Claude, or both
Slash command
/midnight-cq:quality-checkThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **This skill is for running checks and fixing failures.**
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
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-compiler --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-compiler. If .compact source changed but managed/ was not recompiled, tsc will report phantom type errors. Fix: run compact-compiler --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/contracts-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/ | npx compact-compiler --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 |