Command Palette

Search for a command to run...

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

Map Data

Entity-relationship diagram from committed schema declarations (no database connection; Prisma models over Entity Framework fluent mappings over SQL migration…

БесплатноЗапускает вложенные скрипты
melodic-softwareот melodic-software★ 34 звезды на GitHub

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

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

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

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

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

Map data

Repository context

The current repository is both the consumer, whose convention home declares where artifacts land, and the default subject, whose tracked files declare the schema.

Collect with an individual Bash call, one command per call: the project root, git rev-parse --show-toplevel. Treat a failure (not a repository, git unavailable) as an unknown value and carry on; ${CLAUDE_PROJECT_DIR} is the resolver's --root either way.

Purpose

Answer "what are the entities and how do they relate" from declarations in the tree. Every entity and every cardinality traces to a named file. The scripts collect and render. Do not draw a box the script did not emit, and do not invent a cardinality the script did not record.

This is not a C4 diagram: an entity-relationship diagram is not one of the C4 views (the record is under Gotchas).

Resolve home and dialect

Read ${CLAUDE_PLUGIN_ROOT}/reference/config.md first. This skill writes into architecture_dir. It does not read landscape_dialect and adds no dialect key: the diagram dialect is diagram_dialect.data from the authoring-formats topic doc.

Run bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-convention-home.sh" --root "${CLAUDE_PROJECT_DIR}" and resolve architecture_dir per ${CLAUDE_PLUGIN_ROOT}/reference/config.md "Where the config lives" and "Resolution order, per key"; never parse the root instruction file yourself.

Resolve diagram_dialect.data by restating this ladder, then running the resolver rather than parsing the topic doc yourself. The ladder is a resolution order, not a task list:

1. Anchor at the repository root: `${CLAUDE_PROJECT_DIR}` when set, otherwise
   `git rev-parse --show-toplevel`. Never a CWD-relative read.
2. Resolve the convention home `<home>` with the bundled resolver above. Never hand-parse the root
   file.
3. The printed home is repo-relative: join it to the root, then pass
   `<root>/<home>/authoring-formats/README.md` to the resolver.
4. Layer order is one layer deep: an explicit `--dialect` argument, then the team convention doc,
   then the documented default `mermaid`. There is no personal override.
5. Default: `diagram_dialect.data` is `mermaid`. Allowed values are `mermaid` and `dbml`.
6. Degrade soft, and say so. No pointer, no doc, no key, or an unrecognized value each resolve to
   `mermaid`. The resolver names the cause on stderr. Do not hard-fail and do not ask the operator
   to create the surface mid-task.
7. Report provenance: the key, the value, and the layer (`argument`, `team convention doc <path>`,
   or `default`).
bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-diagram-dialect.sh" --kind data \
  --formats "<root>/<home>/authoring-formats/README.md"

Omit --formats when no convention home resolved. Stdout is mermaid or dbml. An explicit --dialect on the invocation wins and the resolver is not required.

This skill never writes the consumer's root instruction file or its topic doc.

Build the record

"${CLAUDE_SKILL_DIR}/scripts/collect-data.sh" \
  --repo "<subject-repo>" --out "<architecture_dir>/data-model.json" \
  --generated-on "<YYYY-MM-DD|unknown>"

Pass --generated-on from git -C <root> log -1 --format=%cs, or unknown when that fails. Pass --live only when the invocation asked for a live connection: the script opens none, writes a refusal, and does not read the schema.

The record is schema_version 1, one object per line. status is drawn or refused; a refusal names reason and writes no relationships. Shipped tiers, first present wins the diagram:

  • model / prisma. *.prisma model blocks.
  • orm / ef-fluent. A stated subset of one-to-many and one-to-one chains. The chain starts at Entity<T>() or, in a file that declares exactly one class X : IEntityTypeConfiguration<T> (also among several base types), at the Configure builder parameter. HasOne/HasMany take a generic argument or, for one-to-many, a lambda navigation (HasMany(e => e.Posts).WithOne(e => e.Blog), HasOne(e => e.Blog).WithMany(e => e.Posts)); the navigation's target comes from the property declared on the configured entity's class in the scanned .cs files (ICollection, List, IList, IEnumerable or HashSet of one identifier for a collection, T or T? for a reference). HasForeignKey and HasPrincipalKey take one string literal or one single-member lambda. Requiredness is an explicit IsRequired(), IsRequired(true) or IsRequired(false); with none, it is the foreign-key property's declared type on the dependent class: T?, Nullable<T> and string? are optional, and int, uint, long, ulong, short, ushort, byte, sbyte, Guid, DateTime and DateTimeOffset are required.
  • migration / sql-migration. *.sql under a migrations directory at any depth, including one at the repository root, replayed in path order. The readable statements are CREATE TABLE
Полный SKILL.md на GitHub

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

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

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

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

  • evals/evals.json
  • scripts/collect-data.sh
  • scripts/collect-data.test.sh
  • scripts/render-data.sh

FAQ

Что делает скилл Map Data?

Entity-relationship diagram from committed schema declarations (no database connection; Prisma models over Entity Framework fluent mappings over SQL migration statements, reports disagreements). Use for 'map data', 'ERD', 'entity relationship', schema diagram, cardinality, or which tables relate. Not for deployment, runtime state, or data volume.

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

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

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

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить Map Data с