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★ 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:
konsistentavailable in rootpackage.jsonnode_modules/konsistentdirectory exists- a
konsistentscript exists inpackage.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
- Check if
konsistent.jsonalready exists at the project root. - Read
node_modules/konsistent/konsistent.schema.jsonto confirm the authoritative shape. - Read the relevant docs in
node_modules/konsistent/docs/(see References below) before making changes. - If
konsistent.jsonexists: read it, then add/remove/update conventions as requested by the user. - If
konsistent.jsondoes 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:
- 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
haveFilespredicate to ensure a specific other file exists based on the matched file, and usefor.filesto enforce conventions within specific other related files based on the matched file.
- Count the total cohort, the conforming instances, and the nonconforming instances. Always include the denominator; a few matching examples alone do not establish dominance.
- Search for counterexamples as deliberately as you search for supporting examples. Inspect representative conforming and nonconforming instances.
- 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.
- 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).
- For each convention established (either by dominan
Установить 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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic