/code-slop:domain-modelfrom code-slop
Model the stored classes of an app and the rules for their values in Alloy, check the model against the code, and draw it as a PlantUML class diagram. Use for /domain-model, when a class or a property of the domain changes, to find where the layers of an app state different limits, or to review the domain as a diagram. The commands that write and check a diagram need the JVM library code-slop-models, and without it, the skill runs the Alloy Analyzer by hand.
Ships in code-slop. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
An Alloy model of the domain holds a sig for each stored class, a field for each property, and the rules for the values
of each property. The Alloy Analyzer checks its assertions, a conformance test checks the model against the classes and
against every place in the code that states a limit, and a class diagram shows the model. The rules
rules-as-invariants, diagrams-derived-from-model, structure-model-matches-classes, and value-rules-match-model
of rules/models.toml of
code-slop state the principles, and a copy that code-slop vendor wrote has them in
<skill-dir>/../../code-slop/catalog/rules/models.toml. This skill applies them with Alloy and PlantUML.
The table [models] of code-slop.toml (or .code-slop.toml, config/code-slop.toml, or
.claude/code-slop/code-slop.toml) names each path. Without a key, use the files that the repository already has. For
a new model, propose the default to the user, and record the path in [models] when the user changes it.
| Key | Default | Content |
|---|---|---|
readme | the existing README of the models, else models/README.md | the models, the commands that check them, and what they leave out |
alloy | the folder of the existing .als files, else models/alloy | <Model>.als, the Alloy model |
class-diagrams | the folder of the existing diagrams, else docs/class-diagrams | <Model>.puml and <Model>.svg, the class diagram |
Read the file readme first. It names the model, its conformance test, and the classes that the model leaves out.
Run the commands that the file readme names. A JVM build with the library code-slop-models has the command
class-diagram <write|check> <alloy> <class-diagrams> of the class de.seuhd.codeslop.models.alloy.ClassDiagramKt
(models/README.md of code-slop). A Gradle
build runs it as a task, such as gradle classDiagrams. Another build runs it with java -cp, with the jars of the
library, the Alloy Analyzer, PlantUML, and the Kotlin standard library on the classpath. The conformance test runs with
the tests of the repository.
The mode write writes the class diagram of each Alloy model. The mode check fails when the Alloy Analyzer finds a
counterexample to an assertion, when a diagram differs from its model, or when a diagram has no model. Both modes fail
for a class sig without an instance in the scope of the command. Commit the diagram together with the model
(diagrams-derived-from-model).
Without the library, check each assertion in the Alloy Analyzer, write the PlantUML class diagram from the model by
hand, and tell the user that no check compares the diagram with the model (diagrams-derived-from-model).
/* ... */ at the top of the model starts with its subject, such as "The domain model of the
app.", which becomes the title of the class diagram. A line comment gives no title.id,
createdAt, and updatedAt (structure-model-matches-classes). one stands for a required property, lone for an
optional one, set or some for a collection, and seq for a list in its order.abstract sig Status {} and one sig OPEN, PAID, CANCELED extends Status {}.Text, Number, or Bool, stands for the values of a property at the limits of its
rules. The one sigs of Text and Number name these values, such as ShortText, LongestText, TooLongText,
BelowMin, Min, Max, and AboveMax. A one sig can also name a value that the store refuses, such as
TextWithNul for a text column of PostgreSQL. Do not use the built-in sig String for a property: The Alloy Analyzer
has no string atom without a literal, so the class has no instance, and the class diagram fails.valid<Sig><Field> states which of these values the code accepts for a property, and a function
without parameters, such as fun customerNameMaxLength: Int { 100 }, states a bound (value-rules-match-model).check command
states a rule that follows from the facts, such as that no text property accepts a value that the store refuses. A
broken assertion is a finding (rules-as-invariants).one gives 1, lone 0..1, some 1..*, and set
*. An Alloy field declares no multiplicity for the source end, so two runs of the Alloy Analyzer with a scope of 4
derive it. One run checks whether a target object can exist without a source object, and the other whether two
source objects can refer to the same target object. A fact such as one open order per customer gives 1 at the source
end.code-slop-models moves each multiplicity that
overlaps an edge, an arrowhead, a class, or another label to the nearest free place.When a property of a stored class is added or changed, change the model in the same step:
valid<Sig><Field>. When the model has assertions over all text properties, such as one about the values that the
store refuses, add the predicate of a text property to each of them.structure-model-matches-classes, value-rules-match-model).diagrams-derived-from-model).The conformance test checks (structure-model-matches-classes, value-rules-match-model):
valid<Sig><Field> accepts, by sending each value to
the code that stores the class, such as a service or a repository;docs/models/jvm.md of
code-slop shows how a JVM app marks its stored classes and how the test reads the places of each bound.
A value that one place accepts and another refuses is a finding. Compare it with the requirement before you change the model or the code, and name the classes that the model leaves out.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
9 skills in this plugin
/adversarial-reviewReview the code of a whole repository adversarially for defects of functional correctness, safety and security, robustness, maintainability and readability, architecture, and documentation, and for fixes that hide a defect instead of removing its cause, and report only the defects that a reproduction or the exact lines show. Use when the user asks for an adversarial, critical, deep, or security review of a repository or a code base, asks to find the bugs or the weak points of a project, wants an audit before a release, or runs `/code-slop:adversarial-review`. Runs the deterministic checks of code-slop first, gives each area to an independent reviewer (a subagent in Claude Code and Codex), lets a second pass try to disprove each finding, and writes `build/code-slop/adversarial-review.md`. Changes nothing in the repository. For a change, a branch, a commit range, or a pull request, use `/code-slop:adversarial-review-diff`./adversarial-review-diffReview one change adversarially for defects of functional correctness, safety and security, robustness, maintainability and readability, architecture, and documentation, and for fixes that hide a defect instead of removing its cause in the changed lines and the code that depends on them. The change is the diff from the merge base with the default branch to the working tree, a commit range, or a pull request or merge request by its number, which gh or glab read without changing it. Use when the user asks to review, break, or audit a change, a branch, a commit range, a PR, or an MR adversarially, asks what a change breaks, wants a critical review before a merge, or runs `/code-slop:adversarial-review-diff`. Runs the deterministic checks of code-slop on the change, gives each area to an independent reviewer, lets a second pass try to disprove each finding, and writes `build/code-slop/adversarial-review-diff.md`. Changes nothing in the repository./glossaryBuild or maintain GLOSSARY.md for a code repository and check its terminology. Use when the user asks for a glossary of a code base, for proposed definitions, for a check of competing names, or for a check that the comments, the Markdown documents, the messages of the program, and the identifiers use one term for each concept, or runs `/code-slop:glossary`. Reads the text through the language adapters and lexers of code-slop with `code-slop glossary`, and writes definitions in the form of ISO 704 and in the format of the glossary of ai-slop. Flags competing names, avoided terms, new terms without a definition, and deficient definitions. Writes the glossary and `build/code-slop/glossary-report.md`, and validates an existing glossary with --check./review-commentsReview the comments and doc comments of a repository, or of the files that a change touches, against the comment catalog of code-slop. Finds comments that narrate or restate the code, explanations that belong in a decision record, pointers to missing records, doc comments that are too long or document private code, missing contracts, filler phrases, and markers of unfinished work. Use when the user asks to review, audit, or clean up the comments of a repository or a change, or runs `/code-slop:review-comments`. Runs `check-comments` and the native tools that the language profiles name, judges the rest against the catalog, and writes `build/code-slop/review-comments.md`. Covers Kotlin, Go, TypeScript and JavaScript, Swift, shell, Lua, Python, and AppleScript./review-testsReview the tests of a whole repository for tests that cannot fail when the behavior breaks (tautological tests), tests that fail when only the implementation changes, tests that never run, and flaky tests. Use when the user asks to review, audit, or check the tests or the test quality of a repository, or runs `/code-slop:review-tests`. Runs the deterministic scanner first, then judges the candidates and the patterns that need judgment against the test catalog, confirms the strongest findings by changing the code in a scratch worktree, and writes `build/code-slop/review-tests.md`. Covers Kotlin, Go, TypeScript and JavaScript, Swift, and shell tests through the profiles of their frameworks./review-tests-diffReview only the tests that a change adds or modifies, and the production code that it changes, for tests that cannot fail, tests coupled to implementation details, and tests that the change weakens. Use when the user has uncommitted changes or a branch and asks to check the tests of the change, such as "review the tests I just wrote", "did the agent fake the tests", or `/code-slop:review-tests-diff`. Uses the test catalog of `/code-slop:review-tests`, adds the rules of a diff (an expected value that changes together with the code, a weakened test), confirms the strongest findings in a scratch worktree, and writes `build/code-slop/review-tests-diff.md`.npx claudepluginhub se-uhd/code-slop-skill --plugin code-slop