Help us improve
Share bugs, ideas, or general feedback.
From apache-cayenne
Imports database schema metadata into a Cayenne DataMap by driving the CayenneModeler reverse-engineering wizard through MCP. For full-schema sync or bulk table import.
npx claudepluginhub apache/cayenne --plugin apache-cayenneHow this skill is triggered — by the user, by Claude, or both
Slash command
/apache-cayenne:cayenne-reverse-engineerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!--
Edits Cayenne ORM model XML files — DataMaps and project descriptors — to add or modify entities, attributes, relationships, embeddables, named queries, stored procedures, and DataNodes.
Designs a data model and generates paired forward/rollback SQL migrations in one pass, staged under docs/features/<slug>/migrations/. Stack-agnostic and follows the repo's own DB conventions. Useful during feature design before implementation begins.
Generates data model documentation including tables, constraints, indexes, retention policies, and migration notes from entities or PRD references.
Share bugs, ideas, or general feedback.
Import a database schema into a Cayenne DataMap by driving the CayenneModeler's reverse-engineering wizard through MCP. Cayenne 5.0 does not yet expose reverse engineering as a direct MCP tool, so the workflow launches the GUI and walks the user through the wizard.
${CLAUDE_PLUGIN_ROOT}/references/project-layout.md — locate or create the project descriptor.${CLAUDE_PLUGIN_ROOT}/references/dbimport-config.md — the field semantics behind every wizard screen, so you can explain options in user terms.${CLAUDE_PLUGIN_ROOT}/references/mcp-tools.md — open_project tool reference and behavior when MCP is not connected.Ask the user (one question, only if not obvious from the request):
Follow project-layout.md to find the existing cayenne-*.xml. If none exists, the user is starting from scratch:
cayenne-modeling's patterns — namespace http://cayenne.apache.org/schema/12/domain, project-version="12", one empty <map name="..."/> plus a sibling empty *.map.xml), orThe descriptor path needs to be absolute when passed to open_project.
Call the MCP tool:
mcp__cayenne__open_project({ "projectPath": "<absolute path to cayenne-*.xml>" })
If the tool is not available (server not registered), surface cayenne-mcp-server/README.md and stop. Do not suggest mvn cayenne:cdbimport or any Gradle equivalent — those build plugins are out of scope.
If open_project returns a non-ok status, surface the error code and message; common ones are modeler_not_found, project_not_found, handshake_timeout. Don't retry blindly — diagnose first.
The user now has the Modeler open. Give them the exact GUI sequence:
org.postgresql.Driverorg.apache.cayenne.dba.postgres.PostgresAdapterTABLE; add VIEW if the user wants views imported.DefaultObjectNameGenerator).^TBL_.*) for tables whose PK columns should be exposed as ObjAttributes. Leave empty unless the user needs PK visibility.skipPrimaryKeyLoading, skipRelationshipsLoading, forceDataMapCatalog, forceDataMapSchema, useJava7Types. See dbimport-config.md for what each does; defaults are usually right.Explain options as the user asks — dbimport-config.md has the semantics. When unsure, recommend the default.
Once the user reports the import is done and they've saved the project:
<dbImport> block inside the DataMap for repeat runs.cayenne-cgen to regenerate Java classes for the new/changed entities. Quote the DataMap name so the cgen skill can pass it to cgen_run.mvn cayenne:cdbimport, the Gradle cdbimport task, or hand-running the cayenne-dbsync Java APIs. The Modeler GUI is the only supported execution path here.forceDataMapCatalog / forceDataMapSchema defensively. They suppress legitimate DB metadata and cause hard-to-debug issues in multi-catalog setups.cayenne-mcp-server/README.md and stop.