Command Palette

Search for a command to run...

Назад к скиллам
скилл № 71721

invariants

Guided authoring of an architectural invariant catalog entry through a 6-step interview (elicit, locate, weight, enforce, number, commit). The agent edits the…

БесплатноБез исполняемых скриптов
lvlup-swот lvlup-sw★ 19 звёзд на GitHub

Установить invariants в Claude Code и Claude Desktop

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

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

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

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

Authoring Invariants Skill

Overview

This skill turns an architectural rule in the head of the author into a registered, enforced catalog entry. It is an authoring conversation, not a question loop.

A catalog is a local file: a Markdown file whose YAML front matter holds schema-version: 3 and an invariants: list. The agent writes the entry into that file, and then validates it:

remit doctor

The invariants-catalog check of doctor parses and merges every registered catalog. A malformed entry, a wrong field, a reused reserved id or an unreadable catalog gives a Warning that names the cause. The next remit prepare binds the catalog into the capsule, and the critic review audits the diff against it.

The division of labor:

  • The agent (you) interviews the author, drafts the prose, proposes the globs and shapes the entry.
  • doctor is the validator. Never declare an entry valid on your own authority. An entry is done when doctor reports invariants-catalog as Pass.

When to Use

  • The author wants a new architectural rule enforced on their own SDLC path. The rule surfaces at ideate, becomes acceptance criteria at planning, and is audited at review.
  • An author says "add an invariant", "enforce that X", "make this a rule".
  • An author wants to correct an entry that is already committed: a wrong summary, a stale glob, a weak audit-prompt (step 7).

When NOT to Use

  • The rule is a one-off lint, not an architectural invariant. A project linter is the right home.
  • You are editing workflow state, running a review or planning. Those are other skills.

The interview (6 steps)

Walk the author through these steps in order. Elicit in prose. Do not make the author think in YAML field names.

1. Elicit: the rule becomes summary

Ask the author to state the rule in one sentence. Distill it into a precise summary. Ask about the failure that it prevents ("what goes wrong if this is violated?"). The answer sharpens the summary and the enforcement.

2. Locate: dimension, applies-to, affinities

  • dimension: a free-text grouping (for example audit-completeness, error-handling).
  • axis is substrate for runtime behavior or authoring for authoring artifacts.
  • references lists relevant paths or URLs. Use [] when the author has no references.
  • applies-to: the globs that the rule governs. Ask the author to name the paths (src/handlers/**, **/*.ts). These are author-named globs, never inferred from the framework (INV-6: the surface is workload-neutral).
  • phase-affinity: the phases where it applies (ideate | plan | delegate | review | synthesize). Absent means all phases.
  • workflow-affinity: the workflow types (feature | debug | refactor | discovery | oneshot). Absent means all.

3. Weight: severity, integrity-class, and the catalog

  • cost-of-load is always-load, reference-only, or archivable. Ask when the rule should be loaded.
  • severity.default: blocking or advisory.
  • severity.by-workflow (optional): a lower severity for cheap workflows (for example oneshot: advisory).
  • integrity-class (enum substrate | sdlc | authoring | user): the override authority of the entry, not its namespace. For a rule of the consumer project, this is user. substrate and sdlc are the classes of Remit itself.
  • The catalog and its id namespace. The choice is Remit substrate or project rule:
    • A user catalog, with U-N ids, holds the rules of your project. It is the default for everyone who consumes Remit. Register it as { path: <file>, tier: user }.
    • The dev catalog, with INV-N ids, is the reserved substrate catalog of Remit. Use it only inside the Remit repository. An INV-N id in a consumer catalog collides with the ids that Remit ships, and doctor reports an INV-* id in a user catalog.

4. Enforce: mode: audit by default, mode: check as an opt-in

Use mode: audit by default. Draft the audit-prompt from the elicited rule: a question that the reviewer answers against the diff. Audit mode is judgment, and it is always portable:

enforcement:
  mode: audit
  audit-prompt: >-
    Does this diff let a request handler return before emitting an audit event?
    Cite the offending file + line.

Offer mode: check only as an advanced opt-in when the rule is mechanically checkable. Propose a declarative combinator tree over grep, structural or heuristic leaves, and show it for confirmation. Validate the registered catalog with doctor after writing the approved entry. See @references/check-mode.md for the vocabulary and the opt-in flow. The enforcement DSL is strict and declarative: there is no script, exec or code field (INV-4), so you cannot write an executable check even if asked.

5. Number: the next free id

Read the target catalog and take the next free id in its namespace: one more than the highest U-N in a user catalog, or the highest

Полный SKILL.md на GitHub

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

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

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

Вложенные файлы

  • references/check-mode.md
  • references/worked-example.md

FAQ

Что делает скилл invariants?

Guided authoring of an architectural invariant catalog entry through a 6-step interview (elicit, locate, weight, enforce, number, commit). The agent edits the catalog file (.remit/invariants.md or a registered user catalog) directly, then runs remit doctor, whose invariants-catalog check validates the catalog. Correcting an existing entry is an edit of that entry by its id, never a second entry. Defaults to mode: audit; mode: check is an advanced opt-in. Triggers: 'add an invariant', 'author an invariant', 'enforce an architectural rule', 'fix/correct/amend an invariant', or invariants. Do NOT use for: editing workflow state or running a review.

Как установить скилл invariants?

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

Скилл invariants запускает скрипты?

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

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

Сравнить invariants с