Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

konsistent-config

БесплатноБез исполняемых скриптовНе проверен

Create or modify a konsistent.json configuration file that enforces structural conventions in a TypeScript codebase. Use when the user wants to enforce…

vercel-labsот vercel-labs★ 204 звезды на GitHub

Об этом скилле

konsistent Configuration

Create or modify a konsistent.json file that enforces structural conventions for the project. The konsistent CLI checks filesystem structure and TypeScript exports/imports — it is not a style linter.

Core Objective

Important reminder: DO NOT write a konsistent.json file that leads to zero errors when running the konsistent check. That would defeat the purpose. The objective is to create a konsistent.json file that identifies violations to patterns used in the codebase, even if they are not being 100% adhered to. Add conventions based on dominant patterns in the codebase, even if other instances violate those patterns.

Treat the existing codebase as evidence from which to infer conventions, not as a specification that every convention must accept. Existing files that do not follow a dominant pattern are expected findings, not proof that the convention is wrong.

A successful configuration can make konsistent exit with violations. The violations are the intended audit output. Only konsistent validate is expected to pass without errors.

Workflow

1. Setting Up The konsistent CLI (only if not set up yet)

Check if the konsistent package is already installed:

  • konsistent available in root package.json
  • node_modules/konsistent directory exists
  • a konsistent script exists in package.json

If not, the konsistent CLI must be installed first. Use the project's package manager. For example, with PNPM:

pnpm add konsistent --save-dev

Then, ensure package.json has a konsistent script which invokes the konsistent CLI. At a minimum:

  "scripts": {
    "konsistent": "konsistent"
  }

If or once all of these are ready, proceed to section 2.

2. Determining Operation Mode Based on Presence Of konsistent.json File

  1. Check if konsistent.json already exists at the project root.
  2. Read node_modules/konsistent/konsistent.schema.json to confirm the authoritative shape.
  3. Read the relevant docs in node_modules/konsistent/docs/ (see References below) before making changes.
  4. If konsistent.json exists: read it, then add/remove/update conventions as requested by the user.
  5. If konsistent.json does not exist: create it at the project root.

3. Creating Or Editing The konsistent.json File

Explore the user's codebase to understand existing structure and naming patterns. Refer to node_modules/konsistent/docs/guides/exploring-codebases.md for what to look out for.

Make sure you review the codebase for structural conventions holistically. For large codebases with multiple layers of nested subdirectories, consider using subagents for individual sections of the codebase. Make each subagent aware of all the analysis requirements outlined in the following subsections, and use subagents to gather raw evidence rather than make final dominance decisions.

When subagents explore separate sections, ensure their findings can be combined into complete relevant cohorts. Each subagent must report the scope it examined, the total instances in that scope, conforming and nonconforming counts, competing patterns, and representative examples. The primary agent must merge these findings, reconstruct each complete cohort, and decide dominance using the combined evidence. A pattern that is dominant within one delegated section is not necessarily dominant across the complete cohort.

Consider conventions between related files as well, not only within a single file. Use the haveFiles predicate to ensure a specific other file exists based on the matched file, and use for.files to enforce conventions within specific other related files based on the matched file.

Required Pattern Evidence

Do not write the configuration until you have recorded the evidence for each candidate convention. For every candidate:

  1. Define the complete relevant cohort, such as all sibling packages, adapters, routes, or barrel files. Consider conventions between related files as well, not only within a single file.
  • For example, use the haveFiles predicate to ensure a specific other file exists based on the matched file, and use for.files to enforce conventions within specific other related files based on the matched file.
  1. Count the total cohort, the conforming instances, and the nonconforming instances. Always include the denominator; a few matching examples alone do not establish dominance.
  2. Search for counterexamples as deliberately as you search for supporting examples. Inspect representative conforming and nonconforming instances.
  3. Compare competing patterns. By default, a candidate is dominant only when it occurs at least three times and accounts for at least two-thirds of the relevant cohort.
  4. When encountering competing patterns without a dominant "winner", pause and ask the user for which pattern to enforce (or whether to not enforce any of them).
  5. For each convention established (either by dominan
Полный SKILL.md на GitHub

Установить konsistent-config в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл konsistent-config?

Create or modify a konsistent.json configuration file that enforces structural conventions in a TypeScript codebase. Use when the user wants to enforce consistent code structure, validate exports/imports across files, ensure directories contain required files, enforce naming patterns, add/remove/update convention rules, configure case map overrides for acronyms or special casing (kebabToPascalMap, kebabToCamelMap), or troubleshoot why konsistent is reporting violations. Triggers on: "konsistent", "konsistent.json", "enforce conventions", "structural consistency", "consistent exports", "consistent structure", "code conventions config", "add convention", "update convention", "fix konsistent errors", "case map", "case override", "acronym casing".

Как установить скилл konsistent-config?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл konsistent-config запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить konsistent-config с