Agent skill

Add Opik Code Quality Hook

by comet-ml in comet-ml/opik

Checklist for wiring a new linter into Opik's Code Quality pipeline: the four files to edit, the silent-failure gotchas and the pass/fail verification loop.

Apache-2.0Auto-check passedDevelopment

Install Add Opik Code Quality Hook

skills CLI
$ npx skills add comet-ml/opik --skill add-code-quality-hook -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install comet-ml/opik add-code-quality-hook --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/comet-ml/opik.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/add-code-quality-hook .claude/skills/add-code-quality-hook && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-code-quality-hook
GitHub stars
22k
Token cost
~2.3k tokens
SKILL.md length
1,173 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Checklist for wiring a new linter into Opik's Code Quality pipeline: the four files to edit, the silent-failure gotchas and the pass/fail verification loop.

  • Works in 4 steps: .pre-commit-config.yaml — add the hook → scripts/precommit-hook-descriptions.tsv… → scripts/precommit-detect-hooks.py —… → …
  • Adding a pre-commit linter or formatter to the Opik repo
  • SKILL.md covers The wiring files, Retroactive step — fix the…, Verification loop and Checklist
  • Calls python3, hadolint and make; reaches github.com

What it does

Opik runs all linters through one pipeline: pre-commit locally and a Code Quality workflow in CI that works out, for each pull request, which hooks have files to check and runs one job per matched linter. Because of that design, a missed edit produces a silent gap rather than a loud failure. The skill lists the four files every new linter touches: `.pre-commit-config.yaml`, `scripts/precommit-hook-descriptions.tsv`, `scripts/precommit-detect-hooks.py` and `CONTRIBUTING.md`.

It stresses details such as pinning a hook's `rev` to a tag or SHA, writing an explicit `files:` path regex because CI routes work by path rather than by `types:`, choosing a hook name that the description keyword can match, and the blank-description trap. It also covers the `TOOLCHAIN_BY_ID` and `TYPED_IDS` settings, a policy for fixing versus suppressing existing violations, and a verification loop. The worked examples are actionlint and hadolint, the first Docker-image hook; the excerpt stops partway through the first file's notes.

When your agent uses it

  • Adding a pre-commit linter or formatter to the Opik repo
  • Checking that a new hook also runs in the CI Code Quality workflow
  • Deciding whether to fix or suppress existing violations when enabling a linter

Example prompts

  • “Add shellcheck as a new pre-commit hook and wire it into the Code Quality CI.”
  • “Why does my new hook pass locally but never run in CI?”
  • “Enable a YAML linter and tell me whether to fix or suppress the existing violations.”

Requirements

  • A checkout of the Opik repository that uses pre-commit

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. .pre-commit-config.yaml — add the hook
  2. scripts/precommit-hook-descriptions.tsv — add the description row
  3. scripts/precommit-detect-hooks.py — toolchain and content-type maps
  4. CONTRIBUTING.md — "how to run locally" note

What it can do on your machine

Read from SKILL.md and the folder at commit f217a86. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3
    • hadolint
    • make
    • apt-get

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Opik Code Quality Hook loads about 2.3k tokens when it runs. Until then it costs about 151 tokens; SKILL.md has 1,173 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~151
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from comet-ml/opik at commit f217a86, republished under its Apache-2.0 licence (© comet-ml). 1,173 words, ~2,292 tokens.

Download SKILL.mdSave it as .claude/skills/add-code-quality-hook/SKILL.md (or your agent's skills folder).
name
add-code-quality-hook
description
Recipe for wiring a new linter into Opik's unified 🐙 Code Quality pipeline (pre-commit + CI). Use when adding a pre-commit-driven linter/formatter to the repo — enumerates every file that must change (`.pre-commit-config.yaml`, `scripts/precommit-hook-descriptions.tsv`, `scripts/precommit-detect-hooks.py`, `CONTRIBUTING.md`), the non-obvious gotchas (mandatory explicit `files:`, the blank-description trap, `TOOLCHAIN_BY_ID`/`TYPED_IDS`), the retroactive fix-vs-suppress policy, and the pass/fail verification loop. Worked examples: actionlint (live) and hadolint (OPIK-6673).

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):

yaml
- repo: https://github.com/rhysd/actionlint
  rev: v1.7.12
  hooks:
    - id: actionlint
      name: ⚙️ actionlint — github workflows
      files: ^\.github/workflows/.+\.(yml|yaml)$

The name: is what the reader and the CI summary see — give it a clear, emoji-prefixed display name matching the house style of the other hooks. The description keyword you add in step 2 is matched against this name, so pick a name containing a stable, distinctive substring (e.g. actionlint, hadolint).

2. scripts/precommit-hook-descriptions.tsv — add the description row

This TSV is the single source of truth for the per-hook descriptions shown in the Code Quality timing/skipped tables (the CI summary comment). Format: <keyword>\t<description>. The keyword is matched as a substring of the hook display name (name: from step 1).

Miss this and the hook renders with a blank description in the CI summary. Add a row:

hadolint	Lint Dockerfiles

Order matters — most-specific first. Matching is first-substring-wins top-to-bottom, so a more specific keyword must precede any that it contains (the file already does this: ruff-format before ruff). If your keyword is a substring of an existing one, place it above that line.

3. scripts/precommit-detect-hooks.py — toolchain and content-type maps

Two maps in this file may need an entry. Most new hooks need neither (default is toolchain: none, no content-type narrowing) — but decide deliberately:

  • TOOLCHAIN_BY_ID — add your hook id here only if the leg's CI job must provision a heavy runtime: java (shells out to mvn), node-fe / node-ts (shells out to npm). Pre-commit's own hooks self-provision in isolated envs and need nothing; a language: golang hook (actionlint) self-builds; a Docker-image hook (hadolint) runs the image — all of these are none. code_quality.yml branches its setup steps on matrix.leg.toolchain, so a wrong value means a job either wastes minutes provisioning an unused runtime or lacks the runtime it needs.

  • TYPED_IDS — add your hook id here only if it carries an upstream types: that narrows its files: match to a content suffix, so the detector doesn't emit a leg that would no-op at runtime. Value is the tuple of suffixes the hook actually acts on (e.g. (".py", ".pyi")). Symptom of a missing entry: the CI timing comment reports fewer ran rows than emitted legs ("detect over-emitted a leg"). If your files: regex is already suffix-precise (like actionlint's \.(yml|yaml)$), you don't need TYPED_IDS.

Rule of thumb by hook type:

Hook typeTOOLCHAIN_BY_IDTYPED_IDS
Docker-image linter (hadolint)none (omit)usually omit — make files: suffix-precise
language: golang/self-built (actionlint)none (omit)omit if files: is suffix-precise
Python tool (ruff, mypy)none (omit)add suffixes if files: is a broad dir regex
Shells out to mvnjavaas needed
Shells out to npm (FE/TS)node-fe / node-tsas needed
Show full SKILL.md (470 more words)Show less
4. CONTRIBUTING.md — "how to run locally" note

Add a short section alongside the existing GitHub Actions workflows (actionlint) note: what the linter checks, that it runs in the unified 🐙 Code Quality workflow and locally via pre-commit, and that make hooks enables it. If the hook needs a local dependency (a Docker daemon for hadolint, etc.), say so; if pre-commit self-provisions it (actionlint builds from source), say that instead.

Retroactive step — fix the existing violations

Adding a linter to a repo that has never run it will surface pre-existing violations. The gate must be green on day one. Policy, in order of preference:

  1. Fix the violation in place — this is the default. Most findings are real and worth fixing.
  2. Suppress inline, with a reason, next to the code — only when a fix would be genuinely undesirable. The canonical case: exact-pinning rolling-channel OS packages (e.g. apt-get install foo=1.2.3), which rots as mirrors move — the honest answer is an inline # hadolint ignore=DL3008 with a one-line why. Inline suppression is scoped to that one line and visible in review.
  3. Never a global config-file ignore. A repo-wide ignore (a .hadolint.yaml ignored: list, an eslint config-level disable) fails open on every future file — it silently exempts code no one has reviewed. Inline-with-reason keeps the gate strict on everything new.

See the OPIK-6673 discussion for a worked case where some rules genuinely couldn't be honestly fixed and inline-with-reason was the right call.

Verification loop

Before opening the PR, confirm the wiring end-to-end — don't trust that the four edits compose:

  1. Detect emits a leg for a target file. Run the detector against a file the hook should gate and confirm your hook id appears in legs with the right toolchain:

    bash
    python3 scripts/precommit-detect-hooks.py .pre-commit-config.yaml path/to/target.file

    If it lands in skipped instead, your files: regex doesn't match. If it errors about types: without files:, add the files: regex (step 1).

  2. Hook passes clean. Run it on the current tree and confirm green (this is also the retroactive check):

    bash
    pre-commit run <hook-id> --all-files
  3. Hook fails on a new violation. Introduce a deliberate violation in a target file and confirm the hook catches it, then revert. A hook that can't fail isn't gating anything.

  4. Description resolves. Confirm the summary won't render blank:

    bash
    echo "<your hook display name>" | python3 scripts/precommit-hook-desc.py

    Expect <name>\t<description> — an empty second column means the keyword row (step 2) is missing or mis-ordered.

Checklist

  • .pre-commit-config.yaml: hook added with pinned rev and an explicit files: regex
  • scripts/precommit-hook-descriptions.tsv: keyword→description row, most-specific-first ordering
  • scripts/precommit-detect-hooks.py: TOOLCHAIN_BY_ID entry iff heavy runtime needed; TYPED_IDS entry iff types:-narrowed and files: isn't suffix-precise
  • CONTRIBUTING.md: local "how to run" note added
  • Retroactive: existing violations fixed (or inline-suppressed-with-reason); gate green on day one
  • Verified: detect emits the leg, hook passes clean, hook fails on a new violation, description resolves non-blank

© comet-ml, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/add-code-quality-hook of comet-ml/opik.

Open the folder on GitHubat commit f217a86

Compare with similar skills

Add Opik Code Quality Hook next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Opik Code Quality Hook compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Opik Code Quality Hook this skillcomet-ml/opik22k—~2.3kAutomated safety check: PassApache-2.0
Reviewing Changesbitwarden/ios694—~1.1kAutomated safety check: PassGPL-3.0
ReviewdogAgentSecOps/SecOpsAgentKit2191 repos~3kAutomated safety check: PassCustom licence
Standards Autofixshopsys/shopsys350—~2.5kAutomated safety check: PassCustom licence
Authoring CI WorkflowsPostHog/posthog-foss721—~11kAutomated safety check: PassMIT
Babysit PRZenUml/web-sequence150—~871Automated safety check: PassMIT

Similar skills

  • Reviewing Changes

    bitwarden/ios

    Official

    Performs comprehensive code reviews for Bitwarden iOS projects, verifying architecture compliance, style guidelines, compilation safety, test coverage, and security requirements.

    694 GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Reviewdog

    AgentSecOps/SecOpsAgentKit

    Automated code review and security linting integration for CI/CD pipelines using reviewdog.

    219 GitHub starsUsed in 1 repo~3k tokens
    DevelopmentAuto-check passed
  • Standards Autofix

    shopsys/shopsys

    Fixes the violations reported by a failed coding-standards check (ecs, phpstan, phplint, twig-lint, markdown, yaml, and the storefront's tsc, biome and knip) by editing the source directly from the…

    350 GitHub stars~2.5k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Authoring CI Workflows

    PostHog/posthog-foss

    Official

    A skill your agent uses when adding or editing a GitHub Actions workflow, composite action, or reusable workflow under .github/ — new CI jobs, triggers, matrices, checkout/clone tuning, action…

    721 GitHub stars~11k tokensUpdated today
    DevelopmentAuto-check passed
  • Babysit PR

    ZenUml/web-sequence

    Monitor and diagnose GitHub Actions checks on ZenUML web-sequence PRs, fixing code-caused CI failures when appropriate.

    150 GitHub stars~871 tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Ways Of Working

    devantler-tech/ksail

    Codifies devantler-tech engineering practices: agent-first development workflow, TDD, CI/CD pipelines, GitHub Flow, code quality gates, and Kubernetes workflows with ksail.

    166 GitHub stars~2k tokensUpdated today
    DevOps & CloudAuto-check passed

More from comet-ml/opik

All 19 skills in this repo
  • Shows how to add product analytics events to Opik's frontend, Java backend and Python SDK, all reporting through Segment to PostHog with an opik_ name prefix.

    22k GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Investigates a failed Opik end-to-end test from CI, TestOps or a local run, decides regression versus flake, and proposes a fix without editing tests.

    22k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Rules for writing PR descriptions, changelog entries and feature documentation in the Opik repository, including the exact headings that CI requires.

    22k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Turns a code change into one committed, passing Playwright end-to-end spec by resolving the change scope and handing authoring to a companion skill.

    22k GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Starts, rebuilds, and troubleshoots the Opik local dev stack, including an optional Comet Platform integration mode for the Opik team.

    22k GitHub stars~734 tokensUpdated today
    Auto-check passed
  • Specifies how to instrument an opik-backend pipeline with per-stage OpenTelemetry metrics for throughput, latency, errors and queue delay by workspace.

    22k GitHub stars~3.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Add Opik Code Quality Hook

What does Add Opik Code Quality Hook do?

Checklist for wiring a new linter into Opik's Code Quality pipeline: the four files to edit, the silent-failure gotchas and the pass/fail verification loop. Opik runs all linters through one pipeline: pre-commit locally and a Code Quality workflow in CI that works out, for each pull request, which hooks have files to check and runs one job per matched linter. Because of that design, a missed edit produces a silent gap rather than a loud failure.

When should I use Add Opik Code Quality Hook?

Add Opik Code Quality Hook fits situations like: adding a pre-commit linter or formatter to the Opik repo; checking that a new hook also runs in the CI Code Quality workflow; deciding whether to fix or suppress existing violations when enabling a linter.

How do I install Add Opik Code Quality Hook in Claude Code?

Run `npx skills add comet-ml/opik --skill add-code-quality-hook -a claude-code`. Or copy the skill folder (.agents/skills/add-code-quality-hook in comet-ml/opik) into .claude/skills/add-code-quality-hook in your project. Claude Code loads it when a task matches its description.

How do I install Add Opik Code Quality Hook in Codex?

Run `npx skills add comet-ml/opik --skill add-code-quality-hook -a codex`. Or copy the skill folder (.agents/skills/add-code-quality-hook in comet-ml/opik) into .agents/skills/add-code-quality-hook in your project. Codex loads it when a task matches its description.

Can I use Add Opik Code Quality Hook in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add comet-ml/opik --skill add-code-quality-hook -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-code-quality-hook, .gemini/skills/add-code-quality-hook, .github/skills/add-code-quality-hook and .opencode/skills/add-code-quality-hook in your project.

What does Add Opik Code Quality Hook need to run?

Going by SKILL.md and its folder, Add Opik Code Quality Hook needs the command-line tools its instructions call (python3, hadolint, make and apt-get). Our summary lists: A checkout of the Opik repository that uses pre-commit.

Does Add Opik Code Quality Hook access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Add Opik Code Quality Hook safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Opik Code Quality Hook use?

Add Opik Code Quality Hook is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Opik Code Quality Hook use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Opik Code Quality Hook?

Skills that share tags, products or a category with Add Opik Code Quality Hook: Reviewing Changes (bitwarden/ios, 694 stars), Reviewdog (AgentSecOps/SecOpsAgentKit, 219 stars), Standards Autofix (shopsys/shopsys, 350 stars) and Authoring CI Workflows (PostHog/posthog-foss, 721 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Opik Code Quality Hook?

comet-ml (a GitHub organization) maintains it in comet-ml/opik, which has 22,412 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 7, 2026.

Source: comet-ml/opik on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.