К основному содержанию
скилл CX Codex

codometer-measure — скилл для Claude Code: что делает и как установить

Скилл codometer-measure для запуска codometer и разбора его отчётов: подсказывает агенту, как задать конфиг, куда писать JSON и badge-блок и как поставить гейт в CI.

MIT 363 установок обновлён 2026-10-24

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add organizzolini/codebase --skill codometer-measure -a claude-code
Открыть на GitHub

Что делает codometer-measure

Скилл описывает агенту, как устроен codometer: утилита обходит одну директорию, разбирает всё, что узнаёт, и считает файлы, строки, классы и функции. Отдельно идут заявленные в репозитории соглашения. Обычно это число интереснее.

Запуск всегда идёт по рабочей директории процесса, флага --directory нет. Конфиг задаётся вручную через --config <path>, и без него запуск отклоняется с ошибкой: файл не ищется сам. Экспорт функции в конфиге не распознаётся, такой файл читается как обычный объект. Флаги --output-json, --output-markdown, --check и --format независимы, ни один не включает другой: --check limits,reports проверяет и лимиты, и устаревшие отчёты.

Флаг вывода без пути пишет туда, куда велит конфиг; с путём — в названный файл. Сочетание --output-* с --check reports отклоняется, потому что в только что записанном отчёте устареть нечему. Для CI в скилле есть строка npx @codometer/cli --config codometer.config.ts --check limits,reports. В JSON-отчёте метрики сгруппированы по целям, у каждой есть значение, путь, единица, лимиты и, для селектора comment, файл и строка нарушения.

Какие задачи решает

  • прогнать замер по проекту и получить JSON-отчёт
  • вставить свежий badge-блок в README между маркерами
  • поставить гейт в CI на превышение лимитов
  • найти файл и строку, где пробит бюджет комментариев
  • сузить замер до конкретных глобов через --inputs

Примеры запросов агенту

  • Запусти codometer по текущей директории с конфигом codometer.config.ts и выгрузи JSON в report.json.
  • Проверь перед коммитом, не устарели ли отчёты, и прогони проверку лимитов.
  • Обнови badge-блок в README.md между маркерами codometer.

Как установить codometer-measure

1Через Skills CLI (Vercel)

npx skills add organizzolini/codebase --skill codometer-measure -a claude-code

2Вручную: положить файлы

~/.claude/skills/codometer-measure/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/codometer-measure/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о codometer-measure

Как установить codometer-measure в Claude Code?

Выполните npx skills add organizzolini/codebase --skill codometer-measure -a claude-code — скилл окажется в ~/.claude/skills/codometer-measure/SKILL.md.

Что делает codometer-measure?

Учит агента запускать codometer и разбирать результат: какой конфиг указать, куда направить JSON или markdown, как включить проверку лимитов и как читать метрики из отчёта.

Чем --check limits отличается от --check reports?

Первый проверяет превышение лимитов, второй — устаревание отчётов; можно включить оба сразу через --check limits,reports. Нарушение с severity fail даёт код выхода 1, а warn только печатается.

Исходный текст

SKILL.md · MIT
---
name: codometer-measure
description: Run a codometer measurement, decide where its report goes, or read a badge block or JSON report it produced. Use when running codometer or npx @codometer/cli, choosing --output-json/--output-markdown and --check flags, wiring codometer into a CI step, splicing a badge block into a README, or reading a codometer JSON report's metrics, limits, or failures. Covers the command-line host directly, without assuming any task runner.
license: MIT
---

# Running a codometer measurement

Codometer walks a directory, parses everything it recognizes, and reports what
it counted — as console output, a JSON report, a markdown document, or a badge
block spliced into an existing file. It counts languages the way any analyzer
would — files, lines, classes, functions — and also the declared conventions a
repository holds itself to, which is usually the more interesting number.

## One directory at a time

**Codometer measures one directory and knows nothing about workspaces, task
runners, or project graphs.** Pointed at a project, it measures that project's
own sources and whatever inputs its configuration declares — nothing else, and
nothing about sibling projects. There is no `--directory`: a run always
measures the process's working directory, with no per-invocation override.

```bash
cd packages/widgets && codometer --config codometer.config.ts --check limits
```

Do not assume it takes a project name, a package name, or anything a task
runner would resolve. If a workspace runs it per project, that iteration is the
runner's job, not codometer's. `--inputs [globs...]` narrows a single run to
exactly the globs given, running only `language` analysis over them, with no
configured input — not even the built-in `codebase` one — active.

## Naming the configuration

**`--config <path>` is required.** Codometer never searches for a configuration
file and has no default one: a run without the flag is refused with an error
naming it. The named file answers alone — nothing from any other file is folded
into it — and a relative path is resolved against the working directory, then
the repository root. In this repository the workspace file is
`configuration/codometer.config.ts`; a project's own is its
`codometer.config.ts`. A configuration file is always read as a plain object — exporting a function is
not recognized and falls back to an empty configuration.

`.gitignore` is already in force through file discovery — a build directory or
virtual environment pruned by an ignore file needs no exclusion naming it
again — and git itself is never invoked, so an unversioned directory measures
the same way a repository does.

## Every flag is independent

`--output-json`, `--output-markdown`, `--check`, and `--format` are asked for
separately, and none of them turns another on:

| Invocation | Writes | Fails on staleness | Fails on a breach |
| ---------- | ------ | ------------------ | ------------------ |
| `codometer --config <path>` | no | no | no |
| `codometer --config <path> --check limits` | no | no | yes |
| `codometer --config <path> --check reports` | no | yes | no |
| `codometer --config <path> --check limits,reports` | no | yes | yes |
| `codometer --config <path> --output-json` | yes | no | no |
| `codometer --config <path> --output-json --check limits` | yes | no | yes, after writing |

`--output-json`/`--output-markdown` passed **bare** write wherever the
resolved configuration's own output of that kind declares, and are refused
before anything is measured when the configuration names no such output —
there is then nowhere to write it. Passed **with a path**, that path is used
for this run alone, whether or not the configuration declares an output of
that kind: `codometer --config <path> --output-json report.json` writes there regardless of
what `outputs` says.

Combining an `--output-*` flag with `--check reports` is refused rather than
obeyed: nothing can be stale in the run that just wrote it. A run that both
writes and gates still produces **every** resolved output before it fails, so
the report on disk reflects the current measurement even when the run's exit
code says no.

A **breach** and **staleness** are different findings, never reported as one. A
`warn`-severity breach prints and leaves the exit code alone; a `fail`-severity
breach exits `1`, and only where `--check limits` asked for a gate at all. For
what to do about either, reach for the `codometer-triage` skill.

```yaml
- run: npx @codometer/cli --config codometer.config.ts --check limits,reports
```

## Reading a report

The JSON report groups metrics by target. Every metric carries its value, its
path within its target, a unit (`"bytes"` or `null`), every limit declared
against it, and — for a `comment` selector's metric — the `instances` where
each breaching block was found:

```json
{
  "failures": [],
  "targets": [
    {
      "empty": false,
      "files": 42,
      "name": "codebase",
      "metrics": [
        {
          "instances": null,
          "limits": [{ "breached": false, "label": null, "severity": "fail", "value": 500 }],
          "name": "codebase.typescript.interfaces",
          "path": "typescript.interfaces",
          "unit": null,
          "value": 118
        },
        {
          "instances": [{ "file": "src/main.ts", "line": 4, "measured": 214 }],
          "limits": [{ "breached": true, "label": null, "severity": "fail", "value": 0 }],
          "name": "codebase.custom.TypeScript Comment Budget",
          "path": "custom.TypeScript Comment Budget",
          "unit": null,
          "value": 1
        }
      ]
    }
  ]
}
```

A limit that held is written out exactly like one that did not, so a consumer
can render headroom, not only failures. A `comment` selector's `value` counts
the blocks that broke its own budget, and `instances` names each one's file
and line — `null` on any metric that only counts. `failures` holds what the
run could not do at all — a target that matched no files despite carrying a
limit, a limit bound to a metric nothing measured — and is unrelated to a
breach or staleness.

## Where output goes

What a run prints and what it writes are asked for separately. `--format json`
prints the report and `--format markdown` prints the rendered badges; a path
always names a file, never the console. Left off, `--format` falls back to the
resolved configuration's own required `format` field — never inferred from
which other flags are present.

Two file sinks — `--output-json [path]` and `--output-markdown [path]` —
neither of which implies the other or implies printing.

`--output-markdown` writes into a file somebody else may have written the rest
of. The block sits between two markers, named `<!-- codometer:start -->` /
`<!-- codometer:end -->` unless the configuration renames them; it is spliced
between them when they are there, appended with them when they are not, and
the file is created when it does not exist.

Every file codometer would write is excluded from what it measures, on every
run regardless of flags — a written report left in the count would be stale
the instant it landed, and a splice would move the very markdown metrics it
just wrote into.

## A runtime detail that reads like a bug

Compressed sizes are Node-version dependent, because the bundled zlib differs
between releases. A report written on one Node runtime and checked on another
reads as stale even when nothing in the source changed. Run `--check reports`
on the same runtime the repository pins for everything else, and reach for the
`codometer-triage` skill before concluding a stale report is a real
regression.

© organizzolini · MIT · organizzolini/codebase

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
codebase-inspection Hermes Agent Скилл codebase-inspection для Claude Code анализирует репозиторий через pygount: считает строки кода и файлы, показывает языки и состав проекта. CX Codex +1 459установок ponytail-gain DietrichGebert Скилл ponytail-gain для Claude Code показывает результаты Ponytail в агентном бенчмарке. Он выводит таблицу метрик по запросу /ponytail-gain или вопросу о сэкономленных ресурсах. CX Codex +1 57 000установок cost-diff ruvnet Скилл cost-diff для Claude Code сравнивает два JSON-снимка расходов. Запускается, чтобы проверить, увеличила ли PR-ветка затраты относительно базового снимка. CX Codex +1 248установок Tiltmeter tiltmeter-dev Tiltmeter отслеживает изменения JSON-ответов сторонних API и сообщает агенту о дрейфе схемы до того, как код начнёт доверять новым данным. CX Codex +1 ★ 1звёзд репо Measure measure-sh Подключает ИИ-агента к телеметрии Measure: крашам, ANR, медленным трейсам и сессиям мобильного приложения. Находит причины падений в продакшене. CX Codex +1 ★ 1 449звёзд репо measure-okr-grader product-on-purpose Скилл measure-okr-grader для Claude Code: считает итоговые значения KR в конце цикла OKR, разбирает доказательства и собирает выводы для следующего цикла. Разрешает споры команды о том, хороший ли результат. CX Codex +1 768установок

Из того же набора13

Весь набор →
conformetry-validate Скилл conformetry-validate запускает проверку сгенерированного кода на соответствие шаблонам conformetry и подсказывает, как устранить расхождения. Помогает найти пропущенные файлы и декораторы. CX Codex +1 670установок codependix-configure Скилл codependix-configure помогает создавать и править файлы codependix.config.ts для экспорта графов архитектуры и проверки правил зависимостей в проекте. CX Codex +1 364установок codependix-export Скилл codependix-export для Claude Code запускает экспорт графов зависимостей codependix и проверку архитектурных границ. Выполняет режимы проверки отчётов, целостности связей и записи артефактов. CX Codex +1 364установок codependix-navigate Скилл codependix-navigate учит агента отвечать на вопросы о зависимостях: как проект A доходит до C, что сломается при правке файла. Через codependix path или графы, уже лежащие в репозитории. CX Codex +1 364установок codependix-triage Скилл codependix-triage для Claude Code разбирает сбои и расхождения архитектурных графов codependix. Включается при падении таргетов codependix-bound, нарушении границ модулей или устаревших диаграммах. CX Codex +1 363установок codometer-configure Скилл codometer-configure помогает писать и менять codometer.config.ts: задавать лимиты, входы, исключения и форматы отчёта для Codometer. CX Codex +1 363установок codometer-triage Скилл codometer-triage разбирает упавший codometer --check: отличает превышение лимита от устаревшего отчёта и от прогона, который не смог завершиться, и говорит, что чинить. CX Codex +1 363установок callidescope-trace Скилл callidescope-trace учит агента запускать callidescope и читать напечатанное: глубину и ширину вызовов, кадры стека от точки входа и вердикт gate по одному проекту. CX Codex +1 361установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой