.cursor/skills/tidy-up/SKILL.md
Run typecheck, lint, and tests for both frontend and Go backend to tidy and test the code prior to committing and pushing.
npx skillsauth add grafana/grafana-pathfinder-app tidyupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill runs housekeeping tasks that need to pass before code is committed and pushed.
CI runs npm run check (typecheck, lint, prettier, lint:go, test:go, test:ci) and rejects
code that fails any of those. Running this skill catches those failures early and fixes what
it can.
Read-only alternative: If you only want to validate without fixing anything, run
npm run checkdirectly. It mirrors the CI gate exactly.
These constraints are absolute and override any other instructions:
ALLOWED_VERTICAL_VIOLATIONS,
ALLOWED_LATERAL_VIOLATIONS, ALLOWED_BARREL_VIOLATIONS in architecture.test.ts).Before running any steps, verify the environment:
package.json lives).node_modules/ exists. If missing, run npm install and wait for it to complete.go version and mage --version. If either fails,
warn the user and skip Go steps (4–6) rather than aborting the entire workflow.Steps are numbered to match the order CI runs them. Frontend steps (1–3) must run sequentially because each step may fix files that later steps depend on. Go steps (4–6) are independent of frontend steps and can run in parallel with Step 3 (frontend tests) using parallel tool calls to save wall-clock time.
┌─────────────────┐
│ Prerequisites │
└────────┬────────┘
│
┌────────▼────────┐
│ 1. Typecheck │
└────────┬────────┘
│
┌────────▼────────┐
│ 2. Lint+Prettier│
└────────┬────────┘
│
┌──────────────┼──────────────┐
│ │ │
┌────────▼───────┐ ┌──▼───────┐ ┌──▼──────────┐
│ 3. FE tests │ │ 4. Go │ │ 5. Go tests │
│ (npm test:ci) │ │ lint │ │ │
└────────┬───────┘ └──┬───────┘ └──┬──────────┘
│ │ │
│ │ ┌────────▼────────┐
│ │ │ 6. Go build │
│ │ └────────┬────────┘
└──────────────┼──────────────┘
│
┌────────▼────────┐
│ Summary │
└─────────────────┘
npm run typecheckRun tsc --noEmit via npm run typecheck.
npm run typecheck to verify.npm run lint:fixRun npm run lint:fix which executes both ESLint with --fix and Prettier with --write.
lint:fix completes, verify by running npm run lint && npm run prettier-test.Note: Husky's pre-commit hook runs Prettier on staged files, but that only covers files already staged. The agent may have modified files during Step 1, so running Prettier explicitly here catches everything.
npm run test:ciRun npm run test:ci (Jest with --maxWorkers 4).
architecture.test.ts fails (tier boundary violations are not trivial fixes).Parallelism: Once Step 2 is verified clean, launch Step 3 and Steps 4–6 in parallel using concurrent tool calls.
npm run lint:goRun npm run lint:go (executes mage -v lint / golangci-lint).
npm run test:goRun npm run test:go (executes mage -v test).
go build ./...Run from the repository root:
go build ./...
This verifies the entire Go module compiles. If it fails after Steps 4–5 passed, the issue
is likely a missing dependency — try go mod tidy and rebuild once before stopping.
Common failures and how to handle them:
| Symptom | Likely cause | Action |
| --------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------- |
| Cannot find module '...' in typecheck | Missing npm dependency or stale node_modules | Run npm install, then retry Step 1 |
| 50+ typecheck errors | Branch is far behind main or has structural issues | STOP and ask — do not attempt bulk fixes |
| architecture.test.ts fails | Import violates tier boundary | STOP — these require intentional architectural decisions |
| Jest snapshot mismatch | Intentional UI change | STOP — ask user whether to run jest --updateSnapshot |
| Cannot find package in Go build | Missing Go dependency | Run go mod tidy, retry |
| Go lint could not load | Go module cache stale or missing dependency | Run go mod download, retry |
| lint:fix creates unstaged changes | Agent modified files that aren't tracked by lint-staged | Expected — these will be included in the commit |
When all steps complete, provide output in this format:
Tidy-up complete
| Step | Result | Files modified |
|-----------------|--------|----------------|
| Typecheck | PASS | 3 |
| Lint + Prettier | PASS | 5 |
| Frontend tests | PASS | -- |
| Go lint | PASS | 0 |
| Go tests | PASS | -- |
| Go build | PASS | -- |
-- for steps that only validate.tools
Optimise Grafana app plugin bundle size using React.lazy, Suspense, and webpack code splitting. Use when the user asks to reduce plugin bundle size, optimise module.js, add code splitting, improve initial plugin load performance, split plugin chunks, lazy load plugin pages, or help implement lazy loading in a Grafana app plugin. Triggers on phrases like "optimise plugin bundle size", "module.js is too large", "plugin is slow to load", "code split the plugin", "reduce initial JS payload", or "help me with Suspense in my plugin".
development
Periodic documentation maintenance audit. Finds orphaned docs, detects drift between .cursor/rules/ and docs/developer/, validates doc correctness against source code, tracks structural issues in a persistent backlog, and opens PRs to close highest-priority gaps per run. Use when the user asks to audit documentation, sync docs, or maintain the knowledge base.
tools
Run E2E CLI against a JSON guide to analyze edge cases and behavior. Use when the user wants to test a guide with the e2e CLI for learning purposes, study e2e failures, analyze screenshots, or investigate edge cases in the guide runner.
development
Principal engineer level architecture design review and critique. Use when the user asks for design review, architecture feedback, design partnership, risk analysis of a design doc, or wants to drive ambiguity out of a plan. Never writes code; operates as a conversational design partner.