Skip to content
Back to skills

Code Quality

ASecurity

Set up, repair, update, or diagnose shared JavaScript and TypeScript quality checks with @servrox/code-quality. Use when a repository needs consistent root commands, missing checks, migration baselines, repository-specific checks, and CI wiring.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 29, 2026
ai-agentsjavascripttypescriptrustgojavanoderailsgitdocumentation

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add stark-ai-de/agent-skills --skill code-quality --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Quality?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Quality
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/stark-ai-de-code-quality/badge)](https://www.skillsdirectory.com/skills/stark-ai-de-code-quality)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-quality
description: Set up, repair, update, or diagnose shared JavaScript and TypeScript quality checks with @servrox/code-quality. Use when a repository needs consistent root commands, missing checks, migration baselines, repository-specific checks, and CI wiring.
license: Apache-2.0
metadata:
  author: stark-ai-de
  category: engineering-workflows
  version: "0.1.5"
---

# Code Quality

## Goal

Give maintained JavaScript and TypeScript one set of root quality commands and a blocking full check in CI.

## When to use

Use for shared quality setup, repair, release updates, baseline decisions, repo-specific checks and diagnosis.

## When not to use

Use the repository's native tools for non-JS/TS source. Record non-applicability when the repo has no maintained JS/TS.

## Inputs to inspect

Inspect the repository root, package manager, lockfile, Node version, accepted ADRs, maintained JS/TS, workspaces, tool configs, existing checks and CI.

## Workflow

### Select a workflow

Available workflows are `setup | repair | update | doctor`. Announce the selection and reason when intent and authority are clear. For bare or materially ambiguous requests, show the options and ask only for the missing decision. An options request authorizes no execution.

- `setup` introduces the package, shared root scripts, maintained source coverage, and a blocking CI gate.
- `repair` restores incomplete or inaccurate package, script, check, configuration, or CI wiring.
- `update` qualifies the release or revision permitted by repository policy and reconciles the dependency, lockfile, shared root scripts and their callers.
- `doctor` inspects the integration and reports missing or unverified coverage. Run the existing `quality:doctor` when it is present. Compare existing root scripts and their callers with the shared gates and report duplicates or replaced wrappers. Do not install, update, or repair during diagnosis.

### Apply setup, repair, or update

1. Confirm applicable source and authority. Resolve conflicts with accepted local decisions before changing their scope.
2. Resolve the candidate from the repository's accepted source and version policy. For npm `latest`, inspect the selected stable release's integrity, deprecation, engines and peer metadata. For a required Git pin, inspect the approved full SHA and verify the lockfile resolves to it. Read CLI help and documentation for that exact release or reviewed commit; treat features present only on the default branch as unreleased. Apply only after checking target compatibility and existing release-age and lifecycle policies. Preserve the project's compiler version, including TypeScript 7. Starting with `0.5.0`, the package owns its coverage compiler and no longer requires a consumer TypeScript peer. Isolate any legacy compiler still required by an analyzer within that tool instead of downgrading the application. Recheck peer metadata for the selected release. A blocked release leaves the working dependency and lockfile in place. Record the candidate, failed prerequisite, owner and revisit condition.
3. After the candidate qualifies, run its `code-quality setup` or `code-quality repair` preview from the repository root. For a fresh install use the repository's package runner or an isolated exact-release installation. Check whether that exact CLI supports the built-in `--scope all`. With a compatible candidate, preview the generated `"quality:fix": "code-quality fix --scope all"` entry or migration of the exact old `code-quality fix` script. Before passing `--apply`, reconcile the proposed scripts and their callers through step 6; customized fix commands remain subject to that reconciliation. Apply only authorized compatible edits. If the preview conflicts with the retained compiler or accepted controls, leave those changes unapplied. Continue independently authorized command repairs using the installed toolchain's supported capabilities, and record any unsupported CLI workflow. Keep the approved dependency selector. If the CLI proposes replacing a required pin, leave that edit unapplied and manually merge only scripts and required peers supported by the exact pinned revision. Preserve required wrappers, report any CLI doctor limitation, and verify the consumer wiring directly. Where repository policy leaves it open, use `"@servrox/code-quality": "latest"` in the root manifest. Use the existing package manager to resolve the candidate and verify its exact version and integrity or full Git revision in the lockfile. Frozen installs and day-to-day checks use that lockfile.
4. Use `code-quality.config.mjs` and native tool configs for complete source coverage, named scopes, Knip entrypoints, architecture boundaries and approved repo extensions. Preserve required correctness, compiler, framework and test checks. Make them additional script checks where they apply to quality. Add the shared Oxlint, Oxfmt, Knip, jscpd and Dependency Cruiser checks. Import the shared presets explicitly: setup edits the manifest and native config discovery does not prove policy activation. Prefer one Oxlint config extending Core, Strict, Modularity and Anti-Slop in that order. If separate lint passes are necessary, register every pass with a stable identity and apply the package's `coreCompatibility` export after Core when the selected release provides it; otherwise use a qualified combined config. Keep suite and native type-aware settings aligned and verify inherited settings with the installed tools. In `0.5.0`, the suite's `typeAware: false` only omits the enabling flag; it does not disable native `options.typeAware: true`. Native `options.typeCheck: true` requires type-aware lint enabled in the native config or the suite. Qualify actual framework rule coverage in the framework's own scope; a framework-named preset may provide only compatibility overrides. Verify representative rejecting cases. Missing tooling, invalid input or missing scan coverage is an open blocker.
5. Run the shared report before choosing how to handle existing findings. Reuse the owner's recorded decision. Otherwise use zero findings and fix issues within the authorized scope. Request an owner decision only when a concrete measured remainder needs a migration allowance. A baseline may cover only measured existing findings that the package can represent. Record selected gates, evidence, owner and cleanup or revisit trigger. Create or prune it only as an explicit reviewed action. Keep increases, new findings, configuration or parser failures, tool failures and uncovered checks blocking. Never accept invalid TypeScript configuration as debt, including on an older release that allows it. Lint allowances use file, rule, normalized message and count/value within each pass; they are not unique occurrence fingerprints. A new indistinguishable occurrence can reuse an existing allowance, so inspect the diff as well as the gate. On upgrade to `0.5.0`, review changed Modularity overrides, suppressions and baseline identities: the former `eslint-js(no-restricted-syntax)` budget checks now use `modularity/max-top-level-functions` and `modularity/max-exports`; uncountable CommonJS syntax uses `modularity/no-uncountable-exports`. Compare old and new diagnostics on the same source, fix newly exposed findings, and retain prior allowances until any migration is explicitly reviewed. Do not blindly rename or regenerate baselines.
6. In `setup`, `repair` and `update`, compare the proposed root commands with current scripts and their CI, hook and runbook callers before applying the preview. Add missing commands the selected release supports. If the preview stops on a script name collision, inspect the exact release’s command definition and the existing command. Resolve the collision and recheck the preview before applying. Preserve distinct checks through their existing command or a required extension. Remove duplicate aliases and superseded wrappers only after the replacement proves equivalent scope, configuration and failure behavior. Migrate their callers in the same change.
7. Wire `quality:check` to the repository's mandatory CI job after the frozen install. Verify `quality:doctor`, the full local command, a real rejecting case and hosted required CI at the same candidate when available. Re-running supported setup or repair on the qualified integration should produce no diff; otherwise verify repeatability of manually qualified wiring and report the CLI limitation. From `0.5.0`, invalid TypeScript configuration and unclassified analyzer diagnostics cannot be baselined. On older releases that allow this, register a blocking compiler/config validation extension and verify rejection even with a matching stored allowance.

### Coverage and exceptions

Keep runtime cycle detection separate from source-boundary enforcement. The source graph includes type-only, JSDoc and ambient import relationships. Derive consumer modules and allowed direction from accepted repository evidence. If policy is missing, prepare a concrete map and ask only for that owner decision while continuing authorized repairs. Define the accepted map once, scan callers as well as protected modules, and register source-boundary checking as a required extension. Preserve dependency edges needed for boundary decisions; excluding dependencies and stopping traversal have different effects.

Inspect duplicate scan inputs as well as totals. A maintained directory named `build` or `generated` can match artifact defaults. On releases supporting `duplicates.artifactIgnore`, replace those defaults with precise artifact patterns, or use `[]` when all selected paths are maintained. Preserve dependency/VCS exclusions and native ignore behavior. Verify that a real duplicate in maintained source is detected. If the release lacks the setting, qualify a comprehensive native duplicate check as a required compensating extension; scan all maintained roots together to detect cross-directory clones, and report the shared scan gap until a compatible release is adopted.

After a release upgrade, retire a compensating extension only when the replacement shared gate proves equivalent coverage and failure behavior; preserve independent compiler, framework, test and architecture checks.

Keep cohesive private helpers together. Use documented exact-file exceptions for intentional package facades, decoder boundaries or justified local budgets. Do not introduce shallow wrappers or split cohesive code solely to satisfy counts. Read the selected release's threshold and framework guidance rather than copying all policy values into local configuration.

### Daily commands

Run these scripts from the repository root with the owning package manager. On a qualified release with the built-in scope, run `pnpm run quality:check`, apply authorized fixes with `pnpm run quality:fix`, then rerun `pnpm run quality:check`.

| Script                  | Use                                                                                           |
| ----------------------- | --------------------------------------------------------------------------------------------- |
| `quality:check`         | Full blocking check over configured source and repo extensions                                |
| `quality:check:changed` | Read-only Git-scoped lint and format with an optional comparison base                         |
| `quality:report`        | Check coverage, findings, baseline status and blockers                                        |
| `quality:fix`           | Fix maintained lint and format files through `all`, or select explicit paths or a named scope |
| `quality:doctor`        | Inspect versions, scripts, effective configuration and source coverage                        |

The built-in `all` fallback follows the maintained lint and format roots and native ignores. An existing consumer-defined `scopes.all` takes precedence; show its effective scope during setup. Custom scopes come from the consumer's `scopes` map, not framework presets or lint passes. Override the generated fix selection with `pnpm run quality:fix -- src/orders/` or `pnpm run quality:fix --scope orders` for a configured `orders` scope. These selections replace the default; they do not intersect with a custom `scopes.all`. Check the exact installed CLI's help for feature support and exercise the generated root and focused fixes in a disposable consumer before claiming they work.

Named scopes, explicit paths and changed-file checks cover lint and formatting only, including `--scope all`. Run unscoped `quality:check` for all five built-in gates and required repository extensions before handover and in required CI. Doctor does not replace compiler, framework or test checks and does not prove that intended presets are active; verify presets with a real rejecting case.

Save a diagnostic report with `pnpm --silent run quality:report --json > /tmp/quality-report.json`.
`quality:report` returns zero for a successfully collected report even when `ok` is false.
A blocked gate makes the report command fail. Use `quality:check` for the blocking CI result.

## Safety rules

Keep package-manager trust, release-age and lifecycle controls. Use existing authorization for manifest, configuration and CI edits. Baseline creation or expansion requires the repository owner's recorded acceptance of measured debt.

## References

Use [the package documentation](https://github.com/servrox/code-quality#readme) for the selected release's commands, thresholds and framework coverage. For the `0.5.0` transition, see the [verified release source](https://github.com/servrox/code-quality/tree/69304a2b86a1d80bce74f69306c522051cf0eb28) and [changelog](https://github.com/servrox/code-quality/blob/69304a2b86a1d80bce74f69306c522051cf0eb28/CHANGELOG.md); for npm `latest` consumers, resolve the tag and verify the installed release. Read its [architecture guide](https://github.com/servrox/code-quality/blob/main/docs/architecture-guardrails.md) for runtime/source graphs and deliberate interface exceptions; resolve this link at the selected revision before applying it. Follow accepted local decisions for adoption and exceptions.

## Scripts

The npm package supplies the CLI. Setup and repair preview manifest changes by default and write with `--apply`. The repository's package manager owns the lockfile.

## Output format

Report the lockfile release, checks that ran, baseline decision, and any blocker or unverified hosted result.

## Completion criteria

The full check covers each applicable tool locally and in the required CI job. The integration rejects actual regressions, including invalid configuration despite a stored allowance. Supported setup/repair is idempotent, or equivalent manual wiring is repeatable with its CLI limitation reported. Unresolved compiler compatibility or architecture policy remains an explicit blocker.

## Failure modes

Keep missing or failing coverage unresolved. An exception records exact paths and technical cause, compensating coverage where possible, and an owner and revisit condition.

Files in this skill

  • SKILL.md6 KB
  • agents/openai.yaml420 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.