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★ 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-catalogas 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 exampleaudit-completeness,error-handling).axisissubstratefor runtime behavior orauthoringfor authoring artifacts.referenceslists 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-loadisalways-load,reference-only, orarchivable. Ask when the rule should be loaded.severity.default:blockingoradvisory.severity.by-workflow(optional): a lower severity for cheap workflows (for exampleoneshot: advisory).integrity-class(enumsubstrate | sdlc | authoring | user): the override authority of the entry, not its namespace. For a rule of the consumer project, this isuser.substrateandsdlcare the classes of Remit itself.- The catalog and its id namespace. The choice is Remit substrate or project rule:
- A user catalog, with
U-Nids, 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-Nids, is the reserved substrate catalog of Remit. Use it only inside the Remit repository. AnINV-Nid in a consumer catalog collides with the ids that Remit ships, and doctor reports anINV-*id in a user catalog.
- A user catalog, with
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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- 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), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…