Diagnoses and fixes BESSER errors including installation failures, import mismatches, model construction bugs, generator crashes, Docker issues, and OCL parse failures. Triggered on any traceback mentioning 'besser'.
Ships in besser. 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.
Quick reference for diagnosing and fixing common issues. Organized by
symptom. This is an intentionally flat, single-file skill — a fast lookup
you scan top-to-bottom or search, with no references/ subdirectory.
pip install besser fails with native dependency errorsSeveral BESSER dependencies require system libraries:
| Dependency | Requires | Fix (Ubuntu/Debian) | Fix (macOS) |
|---|---|---|---|
psycopg2-binary | PostgreSQL client libs | apt install libpq-dev | brew install postgresql |
pyodbc | ODBC driver manager | apt install unixodbc-dev | brew install unixodbc |
oracledb | Oracle Instant Client | Download from Oracle | Download from Oracle |
If you don't need a specific database, these won't block core BESSER functionality — most generators work fine with SQLite (no native deps needed).
pip install -e . fails or installs nothingsetup.cfg and pyproject.toml live; setup.cfg holds the package metadata and python_requires).setuptools>=42 and wheel. Upgrade first: pip install --upgrade setuptools wheel.which python (Unix) or where python (Windows).BESSER requires Python 3.11+ (enforced by python_requires = >=3.11 in setup.cfg). Check with:
python --version
If you're on 3.10 or earlier, upgrade Python or use pyenv/conda to manage versions.
venv\Scripts\activate not foundThe activation path is venv\Scripts\activate (capital S). A common mistake in
some docs is venv\Script\activate (missing the 's') — this will fail.
:: Correct:
venv\Scripts\activate
ModuleNotFoundError: No module named 'besser'pip install -e . from the repo root, or pip install besser.source venv/bin/activate or venv\Scripts\activate).pip and python may point to different installations. Use python -m pip install -e . to ensure alignment.ImportError: cannot import name 'X' from 'besser.BUML.metamodel.structural'Check the exact name. Common mistakes:
| Wrong | Correct |
|---|---|
String | StringType |
Integer | IntegerType |
Float | FloatType |
Boolean | BooleanType |
Date | DateType |
DateTime | DateTimeType |
Association | BinaryAssociation (for 2-end associations) |
The primitive types are singleton instances, not classes. You import them
directly: from besser.BUML.metamodel.structural import StringType.
ImportError related to boclThe OCL constraint checker requires bocl==1.0.1 (exact version). If you installed
a different version or it's missing:
pip install bocl==1.0.1
This only affects OCL validation — generators work without it.
ImportError related to antlr4The PlantUML parser requires antlr4-python3-runtime>=4.13.1. The runtime version
must be compatible with the grammar files shipped with BESSER. Install:
pip install antlr4-python3-runtime>=4.13.1
If you get runtime parse errors after upgrading, the ANTLR runtime version may be
too new for the shipped grammar. Pin to 4.13.1 or 4.13.2.
plantuml_to_buml() parses but the model is empty or wrongThe converter only handles a subset of PlantUML class-diagram syntax. If a
.plantuml file converts without error but yields missing classes,
associations, or attributes, the input likely used unsupported notation
(n-ary associations, non-class diagrams, stereotypes/OCL) rather than a
BESSER bug. See the besser-user skill's references/plantuml.md for the
exact supported subset, then adjust the diagram or add the missing pieces in
Python after conversion.
ImportError for optional packagesThese packages are only needed for specific features:
| Package | Needed for | Install |
|---|---|---|
deep_translator | Agent personalization (translation) | pip install deep-translator |
docker | Docker image building in BackendGenerator | pip install docker |
qiskit | Running generated quantum circuits | pip install qiskit |
torch / tensorflow | Running generated NN code | pip install torch / pip install tensorflow |
ValueError: 'My Name' is invalid. Name cannot contain spaces.All B-UML names (classes, attributes, associations, etc.) must not contain spaces.
Use underscores: My_Name.
ValueError: 'my-name' is invalid. Hyphens are not allowed; use '_' instead.Replace hyphens with underscores: my_name.
ValueError: Invalid primitive data typeValid primitive type names for PrimitiveDataType(name): int, float, str,
bool, time, date, datetime, timedelta, any.
More commonly, use the pre-built singletons: StringType, IntegerType, etc.
ValueError: A class cannot have more than one attribute marked as 'id'Only one Property per class can have is_id=True. Pick one primary key attribute.
ValueError: A binary association must have exactly two endsBinaryAssociation requires a set of exactly 2 Property objects as ends.
Check that you're passing ends={end1, end2} with both ends.
ValueError: A class cannot be a generalization of itselfGeneralization(general=A, specific=A) is not allowed. Check that general and
specific are different classes.
ValueError: The model cannot have types with duplicate namesTwo types in your DomainModel share the same name. Each class, enumeration, and
data type must have a unique name within the model.
ValueError: Invalid min/max multiplicitymin_multiplicity must be >= 0.max_multiplicity must be > 0 and >= min."*" or UNLIMITED_MAX_MULTIPLICITY (9999) for "many".ValueError: An enumeration cannot have two literals with the same nameEach EnumerationLiteral within an Enumeration must have a unique name.
TypeError: Expected Property instance, but got XAssociation ends must be Property instances, not classes or strings. Each end
should be: Property(name="...", type=SomeClass, multiplicity=Multiplicity(...)).
model.validate() reports errorsDomainModel.validate() checks structural consistency:
| Error message | Meaning | Fix |
|---|---|---|
| Generalization references class not in model | A Generalization uses a class that wasn't added to types | Add the missing class to the model's types set |
| Association end references type not in model | An association end's type class isn't in types | Add the class to types |
| Constraint context not in model | An OCL Constraint references a class not in types | Add the context class or remove the constraint |
| Circular inheritance detected | A → B → A inheritance loop | Fix the generalization chain |
Always call model.validate() before running generators to catch these early.
OCL constraints must:
context keyword (case-insensitive).inv, pre, post, self, collect, select, exists, forall, size.If the bocl library can't parse a constraint, it falls back to a regex-based
parser. Complex OCL that neither parser handles will be reported as invalid but
won't block generation.
Two distinct OCL failure classes — don't conflate them:
Constraint whose context class isn't in
model.types is a model.validate() error — it fails validation and you
should fix it before generating (see the table above).This skill is the fast lookup for a generator error message: the table
maps symptom → likely cause → first fix. For wrong-output debugging (a
generator that runs but produces nothing or the wrong content) and
per-generator deep dives, defer to the besser-generators skill's
references/debugging.md.
| Symptom | Likely cause | First fix |
|---|---|---|
ValueError: Invalid DBMS | DBMS string is not one of sqlite, postgresql, mysql, mssql, mariadb, oracle | Use exactly postgresql (not postgres) |
ValueError: Invalid backend (Qiskit) | backend_type is not aer_simulator, fake_backend, or ibm_quantum | Pick a valid backend |
subprocess.CalledProcessError (Django) | Django not installed, project name conflict, or invalid Python identifier | python -m django --version; delete stale project; rename |
AttributeError inside WebAppGenerator | gui_model=None was passed | Build a GUIModel first (see the besser-user skill's references/gui-models.md) |
jinja2.TemplateNotFound | BESSER package corrupted or templates missing | pip install --force-reinstall besser |
Raw [[ ]] in generated React files | ReactGenerator template rendering failed silently | Check console for Jinja errors; React uses [[ ]] to avoid JSX clashes |
The Django generator catches subprocess errors and prints them rather than
re-raising — if the generator "succeeded" but produced no project, scroll
back through the console. (A generator that produces no file and no error
is a debugging case → references/debugging.md in besser-generators.)
docker-compose up fails immediatelylsof -i :8000 (Unix) or netstat -an | findstr 8000 (Windows).git submodule update --init --recursive
.env file: The frontend build expects a .env file at besser/utilities/web_modeling_editor/frontend/packages/webapp/webpack/.env. Create one if missing.docker-compose vs docker composeBESSER's docker_deployment.py calls docker-compose (v1 with hyphen). If you
only have Docker Compose v2 (plugin), either:
docker-compose separately: pip install docker-composealias docker-compose='docker compose'The PYTHONPATH must be set to /app in the container. Check that docker-compose.yml
has PYTHONPATH: /app in the backend service's environment.
ValueError: A different container is already running on port 8000The deployment service detected a port conflict. Stop the existing container:
docker ps # find the container using port 8000
docker stop <container_id>
The base image python:3.11-slim doesn't include system libraries for psycopg2,
pyodbc, etc. Add to the Dockerfile:
RUN apt-get update && apt-get install -y libpq-dev gcc
When the generated code doesn't match what you expect from your model:
print(my_class.attributes).print(model.get_classes()).model.types and the association is in
model.associations.Generalization in model.generalizations?Generalization(general=Parent, specific=Child) — general
is the parent, specific is the child.print([lit.name for lit in my_enum.literals]).default_value. It passes validate(), but the Pydantic/SQLAlchemy generators can't serialize an enum-literal default — they emit its raw repr() (the whole enum graph, with timestamps), so pydantic_classes.py / sql_alchemy.py won't even parse (SyntaxError: leading zeros in decimal integer literals are not permitted). Omit the default and set it in the app layer or as a DB column default. (Primitive defaults like True/0 are fine.)When filing a bug report, include:
python --versionpip show besser or check setup.cfg# minimal_repro.py
from besser.BUML.metamodel.structural import (
DomainModel, Class, Property, BinaryAssociation,
Multiplicity, StringType, IntegerType,
)
from besser.generators.sql_alchemy import SQLAlchemyGenerator
# Smallest model that triggers the bug
a = Class(name="A", attributes={Property(name="x", type=StringType)})
b = Class(name="B", attributes={Property(name="y", type=IntegerType)})
assoc = BinaryAssociation(name="a_b", ends={
Property(name="a_end", type=a, multiplicity=Multiplicity(1, 1)),
Property(name="b_end", type=b, multiplicity=Multiplicity(0, "*")),
})
model = DomainModel(name="repro", types={a, b}, associations={assoc})
# Validate first — validate() returns {"success": bool, "errors": [...], "warnings": [...]}
result = model.validate()
assert result["success"], result["errors"]
# Swap in whichever generator reproduces your bug
gen = SQLAlchemyGenerator(model=model, output_dir="./repro_output")
gen.generate(dbms="sqlite")
Run it: python minimal_repro.py. If it reproduces the bug, file it as an issue
at https://github.com/BESSER-PEARL/BESSER/issues with the script and the full
error output.
# Check BESSER is importable
python -c "from besser.BUML.metamodel.structural import DomainModel; print('OK')"
# Check specific generator
python -c "from besser.generators.sql_alchemy import SQLAlchemyGenerator; print('OK')"
# Check OCL support
python -c "import bocl; print(f'bocl {bocl.__version__}')"
# Check Django
python -m django --version
# Check Docker
docker --version && docker compose version
# Run the library example to verify full stack
python tests/BUML/metamodel/structural/library/library.py
# Run tests
python -m pytest tests/ -x --tb=short
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/besser-devContributor guide for developing BESSER itself (https://github.com/BESSER-PEARL/BESSER). Use this skill whenever the user is working *inside* the BESSER source tree — adding a new generator (the most common contribution), adding a new metamodel or sub-DSL under `besser/BUML/metamodel/`, writing pytest tests for generators or metamodels, writing JSON↔BUML converters for the web editor, building Sphinx documentation under `docs/source/`, registering a generator in `SUPPORTED_GENERATORS`, or preparing a pull request to BESSER. Trigger on phrases like "add a new generator", "register in the web editor", "GeneratorInterface", "json_to_buml", "buml_to_json", "write tests for my generator", "build the docs", "open a PR to BESSER", or any work that touches `besser/generators/`, `besser/BUML/metamodel/`, `besser/utilities/web_modeling_editor/`, or `tests/`. Prefer this skill over besser-user when the user is contributing *to* BESSER rather than *using* BESSER to build something else.
/besser-generatorsOperational reference for BESSER code generators — covers per-generator options, generated file layout, regeneration/overwrite behavior, safe customization patterns, template overrides, and debugging generation failures. Use this skill whenever the user is configuring or running a BESSER generator (PythonGenerator, PydanticGenerator, SQLAlchemyGenerator, SQLGenerator, BackendGenerator, RESTAPIGenerator, DjangoGenerator, WebAppGenerator, ReactGenerator, BAFGenerator, QiskitGenerator, JSONSchemaGenerator, JSONObjectGenerator, RDFGenerator, SupabaseGenerator, TerraformGenerator, PytorchGenerator, TFGenerator, FlutterGenerator, JavaGenerator), wondering "where does the output go", "will my edits survive regeneration", "how do I add custom endpoints to a generated FastAPI app", or "how do I switch the database dialect". Trigger on questions about generator parameters (`http_methods`, `nested_creations`, `dbms`, `containerization`, `backend_type`, `shots`, `generation_mode`), generated file paths, template overrides, or how to extend generated code without losing edits across regeneration cycles. Prefer this skill over besser-user when the question is about a specific generator's behavior rather than how to build a model.
/besser:besser-troubleshootingfrom besser
npx claudepluginhub besser-pearl/besser-skills --plugin besserOther plugins' skills for the same job