Create Initial MariaDB MSM Schema

VerifiedSafe

Scaffold a MariaDB Schema Management (MSM) project and author the initial schema version in the development folder using msm.* MCP tools.

Sby Skills Guide Bot
Data & AIIntermediate
9/18/2026
Claude CodeCursorWindsurf
#mariadb#database-schema#sql#schema-migration#mcp

Recommended for

Automated summary

Scaffolds a MariaDB Schema Management (MSM) project and authors the first schema version in the development folder, distributing tables, objects and grants across the sections of <schema>_next.sql.

Strengths

  • Clear section placement (140 for tables and seed data, 150 for idempotent objects, 170 for authorization), which keeps the deployment script's create/upgrade split intact.
  • Writes through msm.set_section_sql_content so the section banners in the file stay untouched.
  • Full scaffolding in one call: the .msm.project folder, a 0.0.1 development script, the releases/ folders and an adjustable initial version.
  • Spells out the concrete pitfalls that break deployment: no DELIMITER in sections 140/170, and CREATE OR REPLACE or DROP IF EXISTS required in 150.

Limitations

  • Assumes a configured mariadb-shell MCP server (msm.* tools) and a MariaDB 11.8 target.
  • Covers only initial creation; releasing versions, updates and deployment are other steps of the MSM lifecycle.
  • Relies on the section model described in the mariadb-schema-management skill, which must be read first.
When to use it

Use it when starting a new versioned MariaDB schema, to scaffold the MSM project and author the initial development script.

When not to use it

Do not use it to change an already released schema; that goes through the MSM update and release steps instead.

Security analysis

Safe
Quality score85/100

The skill provides guidance for scaffolding a MariaDB schema management project and writing DDL/DML via MCP tools. It does not instruct destructive commands, data exfiltration, or unsafe execution. SQL examples are benign and typical schema creation patterns.

No concerns found

How this analysis is made

Examples

Scaffold a new MSM project
Create a new MSM project for a schema called notes-app under ~/projects with the MIT license, then show me the project information and the sections of notes-app_next.sql.
Author tables and a view
In my notes-app MSM project, add a note table (id auto-increment primary key, title VARCHAR(255) NOT NULL, body MEDIUMTEXT) with a 'Welcome' seed row to section 140, and a note_titles view to section 150 that must be safe to re-run.
Set the first release version
Set the development version of my notes-app MSM project to 0.1.0 before we cut the first release.

name: mariadb-schema-management-create description: "Scaffold a MariaDB Schema Management (MSM) project and author the initial schema in the development folder — create the project with msm.create_project and write the first version's tables, objects and grants into the MSM sections of <schema>_next.sql. Use when starting a new versioned/maintainable MariaDB schema, creating an MSM schema project, or authoring the initial development script. Read mariadb-schema-management first for the section model."

MSM — Creating the Initial Schema

This is step 1 of the MSM lifecycle (see mariadb-schema-management for the overview and the full section model). Here you scaffold the project and author the first version of the schema in the development folder. Driven by the msm.* tools of the mariadb-shell MCP server. Assume MariaDB 11.8.

1. Scaffold the project

msm.create_project(
    schema_name="notes-app",
    target_path="<parent dir>",
    copyright_holder="...",   # optional
    license="MIT",            # optional: GPL-2.0 | MIT | BSD | None
)

This creates <schema>.msm.project/ with msm.project.json, the development/<schema>_next.sql working script (initial development version 0.0.1), and the empty releases/{versions,updates,deployment}/ folders. msm.get_project_information returns the schema name, versions and paths.

Do not add the standalone "Start Block" from mariadb-schema-create-script here — sections 010/920 already save and restore the server variables.

2. Author the schema into the right sections

Edit development/<schema>_next.sql by section, using msm.set_section_sql_content(file_path, section_id, sql_content) (and msm.get_sql_content_from_section to read one) so the section banners stay intact. Put each kind of object in the section that matches how MSM deploys it:

  • Section 140 — tables and base data (non-idempotent). CREATE TABLE and standard seed INSERTs only. This becomes a stored-procedure body in the deployment script, so write plain ;-terminated statements with no DELIMITER.

    CREATE TABLE `notes-app`.`note`(
        `id` INT AUTO_INCREMENT PRIMARY KEY,
        `title` VARCHAR(255) NOT NULL,
        `body` MEDIUMTEXT
    );
    
    INSERT INTO `notes-app`.`note`(`title`) VALUES ('Welcome');
    
  • Section 150 — all other objects (idempotent). VIEWs, PROCEDUREs, FUNCTIONs, TRIGGERs, EVENTs. This is emitted at top level with DELIMITER %%; every object must be safe to re-run, so use CREATE OR REPLACE or an explicit DROP ... IF EXISTS first.

    DELIMITER %%
    
    CREATE OR REPLACE SQL SECURITY INVOKER VIEW `notes-app`.`note_titles` AS
        SELECT `id`, `title` FROM `notes-app`.`note`%%
    
    DROP PROCEDURE IF EXISTS `notes-app`.`add_note`%%
    CREATE PROCEDURE `notes-app`.`add_note`(IN t VARCHAR(255))
    BEGIN
        INSERT INTO `notes-app`.`note`(`title`) VALUES (t);
    END%%
    
    DELIMITER ;
    
  • Section 170 — authorization. CREATE ROLE and GRANT. Also a stored-procedure body → plain ;-terminated statements, no DELIMITER.

  • Section 180 — optional REST endpoints (see mariadb-rest-service-create).

  • Sections 130 / 190 — creation helpers. Optional routines whose names must start msm_, defined in 130 and dropped in 190; use them for logic needed only while building the schema.

3. Set the initial version

The version lives in section 910 (the msm_schema_version view). Set it with:

msm.set_development_version(version="0.1.0")

Use whatever development version you intend to release first; MSM starts a fresh project at 0.0.1.

Guidelines

  • Only tables/data go in 140; everything else goes in 150 — mixing them breaks the deployment script's create/upgrade split.
  • Idempotent objects (150) must use CREATE OR REPLACE / DROP IF EXISTS.
  • Keep object definitions grouped and commented; once the file grows, split sections into SOURCE breakout files (see mariadb-schema-management-develop).
  • When the first version is ready, prepare a release (mariadb-schema-management-release).

See Also

  • mariadb-schema-management — lifecycle overview and full section model.
  • mariadb-schema-management-develop — evolving the schema and SOURCE breakout files.
  • mariadb-schema-management-release — preparing the first release.
  • mariadb-create-table, mariadb-create-view, mariadb-create-procedure, mariadb-create-function, mariadb-grant — the underlying DDL.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-initial-mariadb-msm-schema-mu6guq1g/download' --output '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md.part' && mv '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md.part' '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md' && test -s '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/mariadb-schema-management-create' && cp -R '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g' '.claude/skills/mariadb-schema-management-create'

Cursor
test -f '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md' && test -s '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/mariadb-schema-management-create' && cp -R '.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g' '.cursor/skills/mariadb-schema-management-create'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g'

openskills read 'create-initial-mariadb-msm-schema-mu6guq1g'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-initial-mariadb-msm-schema-mu6guq1g/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills