shimwrappercheck
v0.4.13
Published
CLI-Shim, der Projekt-Checks ausführt, bevor ein echtes CLI-Kommando (z. B. Supabase, Git) läuft. Optional: Web-Dashboard zum Konfigurieren von Presets, Trigger-Befehlen, Checks und AGENTS.md.
Readme
shimwrappercheck
CLI shim that runs project checks before a real CLI command runs (for example Supabase or Git). Optional: web dashboard for configuring presets, trigger commands, checks, and AGENTS.md.
Features
CLI & Wrapper
- Supabase, Git, and generic shim: Wraps
supabase,git, or arbitrary CLIs and runs checks first. - Diff-aware checks: Frontend/backend checks depend on changed files (for example
src/vs.supabase/functions/orsrc/supabase/functions/). - Command filters: Run checks/hooks only for specific commands (for example
functions,db,migration,push). - Network retry for flaky Supabase CLI calls.
- Post-deploy hooks: Health ping and logs after deploy.
- Optional auto-push: Automatically run
git pushafter success. - AI review: Provider selectable (
SHIM_AI_REVIEW_PROVIDER=auto|codex|api). Strict: senior software architect checklist (SOLID, performance, security, robustness, maintainability), starts at 100 points, deductions per violation. Output: score, deductions (point, minus, reason), verdict. PASS only if score >= minimum (default 95%) and verdict ACCEPT. Integrated into checks; reviews stored in.shimwrapper/reviews/and optionally as JSON report. - Refactor orchestration (optional):
SHIM_REFACTOR_MODE=interactive|agentcreates a TODO list, state, andrefactor-current-item.jsonfor resume/handoff per item. - Interactive setup wizard: Repo scan and configuration in one run.
- Terminal configuration mode: Set options directly in the CLI (
npx shimwrappercheck config) without the dashboard. - Automatic check dependency installation: Install npm dependencies for active checks on demand (
install-check-deps). - Global install: PATH shims (
supabase,git,shim) in for example~/.local/bin.
Dashboard (Web UI)
- Check Library: All built-in checks with filters (Frontend / Backend / Enforce / Hooks), search, drag and drop into "My Shim". Per check: tool status (whether tools like ESLint/Deno are installed) and a copy-paste command to install missing tools. Check info follows a fixed schema (Purpose/Checks/Passed/Failed/Customize/Note).
- My Shim (Sidebar):
- Trigger Commands: Tags per tab (Enforce / Hooks), for example
git push,supabase functions deploy. Confirm new tags with Enter; saving writes.shimwrappercheckrcand presets. - My Checks: Order of active checks, search, remove, drag to sort, and "updated" timestamp.
- Trigger Commands: Tags per tab (Enforce / Hooks), for example
- Settings:
- Templates: Select preset (for example "Vibe Code"), and for the active preset use ... (options: export, rename). Custom preset: add provider (Supabase/Git). Trigger Commands & My Checks are configurable 1:1 like in the sidebar.
- Information: Port/version, status (
.shimwrappercheckrc, presets file,AGENTS.md,run-checks.sh, shim runner, Husky, Git pre-push, Supabase), project root, last check error, actions ("Run checks only", Config,AGENTS.md), latest check output.
- Config (Raw): Edit
.shimwrappercheckrcdirectly. - AGENTS.md: Edit agent instructions for Cursor/Codex in the dashboard; changes apply immediately.
Checks (Examples)
- Frontend: Prettier, ESLint, TypeScript Check, project rules, check mock data, Vitest, Vite Build, npm audit, Snyk, Update README (sync version from
package.jsoninto README). - Backend: Deno fmt/lint/audit for Supabase Functions.
- Both: AI Review (strict: senior architect checklist, score >= 95%, verdict ACCEPT), SAST, Architecture, Complexity, Mutation, E2E (templates/planned).
- Hooks: Post-deploy health ping, edge logs.
Configuration
- Presets:
.shimwrappercheck-presets.json(presets, trigger commands, check order, toggles). The dashboard also writes.shimwrappercheckrcfor the shell scripts. - Env & RC: All options configurable via environment variables or
.shimwrappercheckrc. - Check tools (per project): Optional
.shimwrapper/checktools/with its ownpackage.json(ESLint, Prettier, TypeScript, Vitest, Vite). Can be created duringinit; then usenpx shimwrappercheck install-toolsor include active check dependencies vianpx shimwrappercheck install-tools --with-check-deps.run-checks.shuses these binaries if present, so tools stay isolated per project (variant B).
Guide: Using shimwrappercheck
1. Install
npm i -D shimwrappercheck2. One-time setup (Wizard + Dashboard)
Everything in one step: install package, run the wizard, start the dashboard:
npx shimwrappercheck setupThe wizard asks about:
- Supabase/Git usage
- Which commands trigger checks/hooks
- Pre-push hooks (Husky)
- AI review (strict: checklist, score >= 95%, verdict ACCEPT; can be disabled with
--no-ai-review) - Creates
.shimwrappercheckrcand optionallyscripts/run-checks.sh, templates.
Afterwards, the dashboard starts automatically and opens in the browser (for example http://localhost:3000). A free port (3000, 3001, ...) is selected automatically.
3. Use the dashboard
Start the dashboard later (from the project root that contains node_modules/shimwrappercheck):
npx shimwrappercheck dashboardThis starts the dashboard from the package directory so Next.js builds the dashboard app, not your host project (avoids "Module parse failed: Unexpected token" on import type if you run from the wrong folder). Optional: npx shimwrappercheck dashboard -- --restart to restart an already running instance.
Alternatively, from inside the package:
cd node_modules/shimwrappercheck/dashboard && npm install && npm run devOr from the shimwrappercheck repo root (if npm run dashboard exists in package.json):
npm run dashboardThen open the URL shown in the terminal in your browser.
In the dashboard:
Trigger Commands (My Shim, left)
- Select tab Enforce or Hooks.
- Type commands (for example
git push,supabase functions deploy) and confirm each tag with Enter. - Changes are saved and applied to
.shimwrappercheckrc/ presets.
My Checks (My Shim, left)
- Drag checks from the Check Library (right) into "My Checks".
- Reorder with drag and drop, remove individual checks.
- Per check: info/settings; tool status shows whether the tool (for example ESLint, Deno) is available and offers a Copy command to install it.
Check Library (right)
- Filters: Frontend, Backend, Enforce, Hooks (multi-select).
- Search, then drag to My Shim to enable.
Settings
- Templates: Switch preset, use ... on the active preset for export/rename; edit Trigger Commands & My Checks like in the sidebar.
- Information: Status of all files/scripts, "Run checks only", links to Config and
AGENTS.md.
Config / AGENTS.md
- Via Settings -> Information or navigation: raw editor for
.shimwrappercheckrcand editor forAGENTS.md.
- Via Settings -> Information or navigation: raw editor for
4. Run checked commands
After setup, use the shim instead of the "bare" CLI:
# Supabase (checks run before the real command)
npx supabase functions deploy <name>
npm run supabase:checked -- db push
# Git (for example pre-push or manual)
npx git push
npm run git:checked -- pushRun checks only (without Supabase/Git):
- In the dashboard under Settings -> Information, click "Run checks only",
or - CLI:
npx supabase --checks-only functions deploy server
Wrapper flags (not forwarded to the real CLI):
--no-checksskip checks--checks-onlychecks only, no Supabase/Git--no-hooksskip post-deploy hooks--no-pushskip auto-push
5. Configuration files
.shimwrappercheckrc(project root): Written by the dashboard when saving (trigger commands, presets, checks). Contains values likeSHIM_ENFORCE_COMMANDS,SHIM_HOOK_COMMANDS,SHIM_CHECK_ORDER, toggles..shimwrappercheck-presets.json: Full preset and check data; the dashboard reads/writes this file and derives the RC from it.
For a Vercel/hosted dashboard: set SHIM_PROJECT_ROOT to the path of the repo root (where RC and AGENTS.md are located).
Install
npm i -D shimwrappercheckGlobal Install (PATH shims)
Install shims into a bin directory (for example ~/.local/bin) so supabase / git / shim can be used without npx:
npx shimwrappercheck install
# Options: --bin-dir <path>, --add-path, --overwrite, --no-supabase | --no-git | --no-shimIf the bin directory is not in your PATH:
export PATH="$HOME/.local/bin:$PATH"Quick Start (without wizard)
- Create checks script and hooks:
cp node_modules/shimwrappercheck/templates/run-checks.sh scripts/run-checks.sh
cp node_modules/shimwrappercheck/templates/ai-code-review.sh scripts/ai-code-review.sh
cp node_modules/shimwrappercheck/templates/husky-pre-push .husky/pre-push
chmod +x scripts/run-checks.sh scripts/ai-code-review.sh .husky/pre-push- Optional in
package.json:
{
"scripts": {
"supabase:checked": "supabase",
"git:checked": "git"
}
}- Use:
npm run supabase:checked -- functions deploy <function-name>
npx git pushSetup Wizard (init)
Run only the interactive init (without reinstalling):
npx shimwrappercheck initDetects Supabase/Git, asks for commands used for checks/hooks, pre-push hooks, AI review (strict: senior architect checklist, score >= 95%), AI review provider (auto|codex|api) and AI review scope (full|snippet|diff), then creates .shimwrappercheckrc. Optional: create .shimwrapper/checktools/ (check tools per project).
Terminal configuration (without dashboard)
If you want to manage settings later entirely in the terminal:
npx shimwrappercheck configThis mode asks about trigger commands, AI review provider/scope, check toggles, check order, and can then automatically install dependencies for active checks.
Check tools (project-local tools folder)
If .shimwrapper/checktools/ was created during init (or created manually with package.json from templates/checktools-package.json), install tools there:
npx shimwrappercheck install-toolsrun-checks.sh will then use ESLint, Prettier, tsc, Vitest, and Vite from that folder if available; otherwise it falls back to the project's node_modules or npm scripts.
With automatic installation of dependencies for currently active checks:
npx shimwrappercheck install-tools --with-check-depsOr separately (reads active checks from .shimwrappercheckrc):
npx shimwrappercheck install-check-depsHow it works
- Based on the configured trigger commands, the shim decides whether checks/hooks should run for the executed command (for example
functions,db,push). - First, your
run-checks.shruns (frontend/backend depending on the diff). - On success, the real CLI (Supabase/Git) is called.
- Optional: post-deploy hooks (health ping, logs), optional auto-push.
- Git push checks run via the pre-push hook (Husky or
.git/hooks/pre-push).
Usage (Overview)
npx supabase functions deploy <name>
npm run supabase:checked -- db push
npx git push
npm run git:checked -- push
# Checks only
npx supabase --checks-only functions deploy server
# Terminal config + dependency installer
npx shimwrappercheck config
npx shimwrappercheck install-check-deps
# Generic shim
npm exec --package shimwrappercheck -- shim docker build .
npm exec --package shimwrappercheck -- shim --cli terraform -- planWrapper Flags
--no-checksSkip checks for this invocation--checks-onlyChecks only, no Supabase/Git--no-hooksSkip post-deploy hooks--no-pushSkip auto-push--no-ai-reviewForwarded torun-checks.sh--with-frontendForce frontend checks--ai-reviewForwarded torun-checks.sh--auto-push(generic shim) Auto-push after command
Command Filters
- Supabase:
SHIM_ENFORCE_COMMANDS="functions,db,migration",SHIM_HOOK_COMMANDS="functions,db,migration"(orall/none). - Git:
SHIM_GIT_ENFORCE_COMMANDS(for examplepush,commit,merge,rebase).
Commands are matched as tokens (for example functions, db, push).
Environment Variables (Selection)
SHIM_PROJECT_ROOTProject root (for example for dashboard on Vercel)SHIM_CHECKS_SCRIPTPath to the checks scriptSHIM_CHECKS_ARGSAdditional arguments forrun-checksSHIM_CONFIG_FILEConfig file (default:.shimwrappercheckrc)SHIM_DISABLE_CHECKS=1Disable checksSHIM_DISABLE_HOOKS=1Disable hooksSHIM_AUTO_PUSH=1|0Auto-push after successSHIM_ENFORCE_COMMANDSSupabase commands for checksSHIM_HOOK_COMMANDSSupabase commands for hooksSHIM_GIT_ENFORCE_COMMANDSGit commands for checksSHIM_GIT_CHECK_MODE_ON_PUSH=snippet|fullAI review scope on push (default:snippet)CHECK_MODE=snippet|full|diff|mixAI review scope forrun-checks.sh/manual runs (diff=snippet)SHIM_AI_REVIEW_PROVIDER=auto|codex|apiAI review provider (auto: prefer Codex, fallback to API key)SHIM_BACKEND_PATH_PATTERNSBackend paths for diff/check detection (default:supabase/functions,src/supabase/functions)SHIM_CONTINUE_ON_ERROR=1Collect check failures and fail at the end (instead of aborting immediately)SHIM_STRICT_NETWORK_CHECKS=1Treat network/TLS infrastructure errors innpm audit/Semgrep as hard failures (default: warn/skip on infrastructure error)SHIM_I18N_REQUIRE_MESSAGES_DIR=1Fail i18n check if nomessagesdirectory exists (default: skip)SHIM_REFACTOR_MODE=off|interactive|agentOptional refactor item flow for--refactorSHIM_REFACTOR_DIR,SHIM_REFACTOR_TODO_FILE,SHIM_REFACTOR_STATE_FILE,SHIM_REFACTOR_CURRENT_ITEM_FILESHIM_REFACTOR_ITEM_INDEX=<n>,SHIM_REFACTOR_ADVANCE=1Resume/next-item controlSHIM_REPORT_FILEOptional JSON report for AI reviewREFACTOR_REPORT_FILEAlias forSHIM_REPORT_FILEAI_REVIEW_DIFF_RANGE,AI_REVIEW_DIFF_FILE,AI_REVIEW_CHUNKAdditional AI review inputs (diff range, diff file, full chunk)SHIM_AI_TIMEOUT_SEC,SHIM_AI_CHUNK_TIMEOUT,SHIM_AI_DIFF_LIMIT_BYTES,SHIM_AI_MIN_RATING,SHIM_AI_REVIEW_DIRSHIM_DEFAULT_FUNCTIONDefault function for health/logsSHIM_HEALTH_FUNCTIONS,SHIM_LOG_FUNCTIONS,SHIM_LOG_LIMITSUPABASE_PROJECT_REF,SHIM_HEALTH_PATHS- Network retry:
SUPABASE_RETRY_MAX,SUPABASE_RETRY_BACKOFF_SECONDS - Generic shim:
SHIM_CLI_*,SHIM_CLI_PRE_HOOKS,SHIM_CLI_POST_HOOKS
Config File
.shimwrappercheckrc in the project root (filled by the dashboard; can be adjusted manually):
SHIM_ENFORCE_COMMANDS="functions,db,migration"
SHIM_HOOK_COMMANDS="functions,db,migration"
SHIM_DEFAULT_FUNCTION="server"
SHIM_AUTO_PUSH=1
SHIM_CHECKS_ARGS="--no-ai-review"
SHIM_BACKEND_PATH_PATTERNS="supabase/functions,src/supabase/functions"
SHIM_GIT_CHECK_MODE_ON_PUSH="snippet"
CHECK_MODE="full"
SHIM_AI_REVIEW_PROVIDER="auto"
SHIM_REFACTOR_MODE="off"
# Optional:
# SHIM_CONTINUE_ON_ERROR=1
# SHIM_STRICT_NETWORK_CHECKS=1
# SHIM_I18N_REQUIRE_MESSAGES_DIR=1
# SHIM_REPORT_FILE=".shimwrapper/reports/ai-review.json"The file is loaded as a shell script.
Templates
templates/run-checks.shRunner for lint, tests, Deno, AI review, etc.templates/ai-code-review.shOptional AI review step (strict: senior architect checklist, 100 points, deductions, JSON score/deductions/verdict; PASS at >= 95% and ACCEPT)templates/extract-refactor-todo.shExtract TODO items from AI review reports (for refactor handoff)templates/husky-pre-pushHusky pre-push hooktemplates/git-pre-pushPlain Git hook
Hard Rules (optional tools)
For SAST, architecture, complexity, mutation, E2E:
- dependency-cruiser:
npm i -D dependency-cruiser - eslint-plugin-complexity:
npm i -D eslint-plugin-complexity - Stryker:
npm i -D @stryker-mutator/core - semgrep: for example
brew install semgrepornpx semgrep
Config templates in templates/: .dependency-cruiser.json, .semgrep.example.yml, stryker.config.json, eslint.complexity.json. Optional setup via the init wizard.
Install automatically (depending on active checks):
npx shimwrappercheck install-check-depsNotes
- For local installs, the shim avoids recursion by detecting the real Supabase CLI.
- The Git wrapper should be called via
npx gitornpm run git:checkedso it does not overwrite the system Git. - Hooks are searched in the repo first (
scripts/ping-edge-health.sh,scripts/fetch-edge-logs.sh), then in the package.
License
MIT (see package.json).
