add-code-quality-hook

A checklist for connecting a new code linter or formatter to Opik's local and CI checks. It covers the files and settings needed for the hook to run correctly.

In plain words
What is it for?
Use it when adding a pre-commit linter or formatter to Opik. It guides changes to the pre-commit setup, descriptions, change detection, and GitHub Actions workflow.
Why use it?
It prevents a linter from being added incompletely and then silently not running, appearing blank in reports, or using the wrong runtime.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/comet-ml/opik/add-code-quality-hook
Any agent
npx skills add comet-ml/opik --skill add-code-quality-hook
Clone the repo
git clone --depth 1 https://github.com/comet-ml/opik

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,332 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02332
Opus 5 $0.00000 $0.01166
Sonnet 5 $0.00000 $0.00466
Haiku 4.5 $0.00000 $0.00233

Measured 2d ago against content hash 8f5d21a2c128, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-code-quality-hook scanned grade A with 0 findings against 26 rules in 11 categories β€” prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency β€” measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/add-code-quality-hook/SKILL.md Β· 110 lines

How it starts

The opening of the file, as written. The whole thing β€” 110 lines β€” stays where its author put it; the contents beside it link to each section on GitHub.

Add a Code Quality Hook

Opik runs all linters through one pipeline: pre-commit locally, and the πŸ™ Code Quality workflow (.github/workflows/code_quality.yml) in CI. CI does not run pre-commit wholesale β€” it derives, per PR, the set of hooks that actually have work using scripts/precommit-detect-hooks.py, then runs one CI job per matched linter. That design makes adding a linter a small, fixed set of edits β€” but each edit is load-bearing, and skipping one produces a silent gap (the hook runs nowhere, or renders blank in the summary, or provisions the wrong runtime) rather than a loud failure. This skill is the checklist.

The whole recipe is a generalization of two real PRs: actionlint (live in .pre-commit-config.yaml today β€” grep it as you read) and hadolint (OPIK-6673, PR #7352 β€” the first Docker-image hook, toolchain: none). Read the actionlint hook alongside this doc; it is the canonical, verifiable example.

The wiring files

Each linter touches these four files. Do all four.

1. .pre-commit-config.yaml β€” add the hook

Add the upstream hook (repo / rev / id). Pin rev to a tag or SHA β€” never a floating ref.

An explicit files: regex is mandatory, not optional. This is the single most common miss. The CI matrix detector (precommit-detect-hooks.py) routes work to hooks by path regex, not by pre-commit's types:. Most upstream hooks (actionlint, hadolint) ship a types:-only match with no files:. If you copy them verbatim, the detector cannot route any file to your hook and CI silently never runs it β€” pre-commit locally still works, so the gap hides until something slips through. The detector guards against this: it raises loudly if a hook has types:/types_or: without files: (see precommit-detect-hooks.py lines ~115). So a missing files: fails the detect step rather than regressing silently β€” but you still must write the regex.

Write a files: regex that captures exactly the paths the linter should gate. Example (actionlint β€” workflows only):

Read the full file on GitHub Β· 110 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen Β· 110 lines Β· 0 tokens per session scan A 8f5d21a2c128

Subscribe to this mod's changes

add-code-quality-hook is a skill published in the GitHub repository comet-ml/opik (21,685 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,332 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories