/claude-toolkit:schema-diagramfrom claude-toolkit
Generates an interactive ERD from a Laravel database — standalone HTML with search, column-anchored foreign keys, and per-table relation inspector. Reads live schema, not migrations.
Ships in claude-toolkit. 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.
Read when SKILL.md points to them.
Produces one file: docs/03-architecture/03-database-erd.html. It opens off a filesystem, on
a plane, with no network and no toolchain — and it draws every table, column, index and
foreign key in the database.
| Piece | Lives in | Needs | Committed |
|---|---|---|---|
| Schema extractor | app/Support/Erd/ErdSchema.php + app/Console/Commands/GenerateErdCommand.php | A migrated database | — |
| Domain map | app/Support/Erd/ErdDomains.php | A human | — |
| Payload | docs/03-architecture/erd-schema.json | — | Yes |
| Diagram app | resources/js/erd/ (React Flow island) | — | — |
| Coverage tests | tests/Feature/Docs/ErdDomainCoverageTest.php | — | — |
| Document | docs/03-architecture/03-database-erd.html | Node | Yes |
| Companion page | docs/03-architecture/03-database-erd.md | — | Yes |
php artisan docs:erd # database -> JSON (needs a DB, no Node)
npm run build:erd # JSON -> HTML (needs Node, no DB)
The split is the design. Either half runs alone, and the committed JSON means the document rebuilds on a machine that has never seen the database.
1. Read the database, never the migrations. Migrations are the instructions; only the database is the result. A mature project's migration folder is full of column changes, index swaps, renames and drops whose net effect is exactly what a parser gets wrong — silently.
2. Every table gets a domain, assigned by a person. A prefix heuristic mis-files tables and
gives no sign that it did. The generator refuses to write when the map has a gap in either
direction. That friction is the feature; do not add a default => arm to make it pass.
3. Commit both outputs. The JSON so schema drift shows up in a pull request diff. The HTML so a reader needs nothing but a browser.
php artisan migrate:status | tail -5 # is the schema at head?
A diagram of a half-migrated schema is worse than none. But do not migrate someone's dev database to build a document — that is a side effect they did not ask for, and it can be destructive. Build in a throwaway instead, and drop it:
mysql -e "CREATE DATABASE erd_tmp"
DB_DATABASE=erd_tmp php artisan migrate --force
DB_DATABASE=erd_tmp php artisan docs:erd
mysql -e "DROP DATABASE erd_tmp"
Say plainly in the summary that you did this and that their database is untouched. The About panel records the migration head it was read at, so the document proves its own provenance.
This is the only part that takes judgement, and everything else is mechanical once it exists.
Read references/domain-map.md. Draft it from the code, then correct it by hand:
ls database/migrations | sed 's/^[0-9_]*//;s/\.php$//' | sort
ls app/Models
Aim for 8–14 domains named after the product's own nouns — never layers. Framework and
package tables (cache, jobs, sessions, media, telescope_*) all go in one system
domain that starts switched off.
Show the user the proposed map before writing it. Getting deployment_mail_sandboxes filed
under Data Services rather than Deployment is a decision they own.
references/schema-extractor.md has both PHP files verbatim. Copy them, then run:
php artisan docs:erd
It will fail listing unmapped tables. That is the gate working — fill them in and re-run.
references/diagram-app.md (seven modules) and references/diagram-styles.md (the
stylesheet). Copy verbatim, then change exactly two things: PRODUCT in ErdBoard.jsx and
About.jsx, and the brand faces at the top of erd.css.
Rewrite the prose in About.jsx for the product. It is the only writing in the document
and the first thing anyone reads.
npm i @xyflow/react @dagrejs/dagre react react-dom
npm i -D @vitejs/plugin-react vite
npm run build:erd
open docs/03-architecture/03-database-erd.html
Verify before calling it done — see the checklist below.
A 1 MB generated HTML file is not readable in a pull request, does not appear in a grep, and
does not render on GitHub. Write docs/03-architecture/03-database-erd.md beside it: a link,
the four figures, the domain table with per-domain counts, what it does not draw, the two
regeneration commands, and a source-file table. That page is what the docs tree indexes and
what a reviewer actually reads.
references/coverage-tests.md. docs:erd --check protects the document; the suite protects
the repository — it fails on the pull request that adds the table, not six weeks later.
- run: php artisan docs:erd --check
php artisan migrate
php artisan docs:erd # fails if a new table has no domain — add it
npm run build:erd
php artisan test --filter=ErdDomainCoverage
git add docs/03-architecture/erd-schema.json docs/03-architecture/03-database-erd.html
Regenerating the JSON and forgetting the HTML leaves a document confidently showing last month's schema. Check both files are staged.
Open the file and confirm each of these. Every failure here renders successfully and is wrong, which is why the list exists.
width/height instead of initialWidth/initialHeight — React Flow skips
measurement, handle bounds never exist, and each edge is dropped in silence.ResizeObserver and rAF, so nodes stay hidden and fitView never lands — a healthy
page reports as broken, with exactly the symptoms of the bug above.useUpdateNodeInternals.stats.relations with all domains on.file://, with the network off. No console error, no blank canvas.auditable_type + auditable_id resolve at
runtime; an arrow to any one table is a claim the schema does not make.system starts off. Cache, queue, sessions and Telescope are plumbing, and most of them
join to nothing but fog.beyondcode/laravel-er-diagram-generator and friends read
Eloquent relations and emit a static image — no search, no inspector, no domains, and a
picture that cannot answer "what references this table".| Don't | Do |
|---|---|
Parse database/migrations | Introspect via Schema::getTables() |
| Infer domains from table-name prefixes | An explicit map, plus a build that fails on a gap |
default => 'system' in the domain map | Let the gate fail; add the table deliberately |
| Fetch the JSON at runtime | Inline it — file:// refuses cross-origin |
| Link a CDN or a webfont | Inline everything; declare fonts brand-first with a system fallback |
width/height on a node | initialWidth/initialHeight — the box is seeded and still measured |
| Migrate the user's dev DB to build a doc | Build in a throwaway database, drop it, say so |
fitView on a setTimeout | useNodesInitialized — the event, not a guess |
| Re-derive nodes when selection changes | Paint state onto the nodes already in state |
| Commit only the HTML | Commit the JSON too — it is the reviewable diff |
| Leave the HTML as the only doc | Write the companion .md — the HTML is not reviewable or greppable |
| Ship a static PNG/SVG "for simplicity" | It cannot answer the one question people open an ERD to ask |
| File | Contents |
|---|---|
references/schema-extractor.md | ErdSchema + GenerateErdCommand verbatim, the payload shape, and the five introspection traps (server-wide getTables(), sentinel migrations, MySQL type noise, morphs, FK-less tables) |
references/domain-map.md | ErdDomains template, how to choose 8–14 domains, the tested 13-colour palette, and the two-way coverage gate |
references/diagram-app.md | All seven resources/js/erd/ modules verbatim, the five silent React Flow failure modes, the browser-throttling trap, and the interaction model |
references/diagram-styles.md | erd.css verbatim — dark/light token blocks, node geometry that must agree with geometry.js |
references/build-pipeline.md | build.mjs verbatim, why one standalone file, the two escaping traps, dependencies, dev loop, and CI |
references/coverage-tests.md | The Pest suite that pins domain coverage, legend completeness, payload shape and morph handling — plus why it must filter on getCurrentSchemaName() to work on SQLite |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nasrulhazim/claude --plugin claude-toolkit43 skills in this plugin
/business-cardSVG business card designer that takes contact details and brand preferences, then produces 12 front design concepts with optional back designs, interactive HTML preview galleries, individual card showcases with front/back flip animation, and print-ready SVG exports with bleed area and crop marks. Supports horizontal and vertical orientations, six layout styles (minimal, corporate, creative, elegant, bold, tech), multiple color schemes, QR code placeholders, social media icons, and logo integration. Use this skill whenever the user asks to design a business card, create a name card, make visiting cards, or says "design business card", "buat kad bisnes", "create name card", "reka kad perniagaan", "design kad nama", "I need a business card for X".
/ci-cd-pipelineCI/CD pipeline builder for Laravel projects — extends Kickoff's existing GitHub Actions CI with continuous deployment pipelines (staging/production), Docker containerisation, secret management, and failure notifications. Generates Dockerfiles, docker-compose.yml, deployment configs for VPS via SSH, container registry push workflows, and leverages Kickoff's /bin scripts (deploy.sh, backup.sh, setup.sh) in automated workflows. Use this skill whenever the user asks to set up deployment pipelines, containerise a Laravel app, configure CD for staging or production, push Docker images to a registry, manage deployment secrets, add failure notifications to CI, or integrate /bin scripts with GitHub Actions. Triggers for requests like "set up CD pipeline", "deploy to staging automatically", "dockerise my Laravel app", "add Docker to my project", "push image to registry", "manage secrets in CI", "notify on failure", "extend CI with deployment", "setup deploy pipeline", "nak deploy guna GitHub Actions", "tambah Docker dalam project", "setup CD untuk staging", "nak auto deploy ke production", "dockerise Laravel app aku", "tambah notification kalau CI fail", "macam mana nak manage secrets dalam GitHub Actions", or "integrate bin scripts dengan CI". Assumes Laravel Kickoff as the baseline — GitHub Actions CI (Pint, PHPStan, Rector, Pest) and /bin scripts (deploy.sh, backup.sh) are already configured. This skill extends that baseline with CD, Docker, and deployment automation.
/code-qualityPHP and Laravel code quality toolchain — static analysis with Larastan/PHPStan, code style enforcement with Pint, automated refactoring with Rector, baseline management for legacy codebases, and CI pipeline integration via GitHub Actions. Use this skill whenever the user asks to check code quality, fix linting errors, run static analysis, modernise PHP code, set up CI quality gates, manage PHPStan baselines, configure Pint presets, or apply Rector rules. Triggers for requests like "run quality check", "fix my code style", "analyse with larastan", "update phpstan baseline", "modernise my PHP code", "set up CI for quality", "check code quality", "pint tak jalan", "nak fix phpstan error", "setup rector", "betulkan code style", "tambah quality gate dalam CI", or "baseline phpstan untuk legacy code". Assumes Laravel Kickoff as the baseline — PHPStan, Pint, Rector, and GitHub Actions CI are already configured. This skill extends and customises that baseline.
/courseware-builderInteractive HTML courseware builder — turns any technical topic, flow, or process into a CD-Courseware-style interactive slide deck with animated diagrams, step-by-step simulation, syntax-highlighted code examples, and key points panels. Use this skill whenever the user wants to create teaching materials, interactive slides, animated flow diagrams, or step-by-step technical walkthroughs — even if they say "buatkan slides untuk topik X", "jadikan courseware", "buat interactive tutorial", or "create a lesson on X". Also triggers for "convert my diagram to interactive slides" or "build a visual walkthrough for my training".
/debuggingSystematic debugging and error recovery for Laravel and PHP projects — a five-step triage that goes reproduce, localise, reduce, fix, guard. Covers reading a stack trace properly, bisecting with git, isolating a failure to the smallest reproducer, telling a symptom apart from a root cause, and closing every fix with a regression test. Includes Laravel-specific traps: N+1 masked as a timeout, queue jobs failing silently on the wrong connection, cache and config caches serving stale values, Livewire state desync, and eloquent/model events firing in unexpected order. Use this skill whenever the user reports something broken, failing, flaky, slow-then-erroring, or behaving differently in production than locally — including "this test is flaky", "why is this failing", "debug this error", "it works locally but not on staging", "find the root cause", "this exception makes no sense", "the queue job never runs", "bisect this regression", "kenapa error ni", "tolong debug", "test ni kejap pass kejap fail", "cari punca sebenar", "jalan kat local tapi tak jalan kat production", or "job queue tak jalan". Pairs with kickoff-pest-testing for the regression test and log-monitor for production-log-driven investigations.
/deploy-appDeploys a Kickoff-based Laravel application to its host by running `bin/deploy` over SSH, then verifies the release and knows what each way it can stop means. Use this skill whenever the user asks to deploy an app, push the latest code to production, check what commit production is running, bring a site back up after a failed deploy, or roll back — "deploy latest", "deploy the app", "tolong deploy", "deploy latest dulu", "push to production", "apa commit dekat production", "site down after deploy", "keluarkan maintenance mode", "rollback production", "kenapa 503". Covers the deploy command and its flags, the post-deploy verification checklist, the recovery path for each failure mode, and the production traps that have already cost time. Does NOT cover provisioning a new host from bare metal (`bin/provision-host`), CI/CD pipeline design (`ci-cd-pipeline`), or writing deploy operations.
Other plugins' skills for the same job