From 995d711c099890fca4bf93a6d1482769b73bb000 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:38:23 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 +++++++++ README.md | 3 +++ plugin.lock.json | 45 +++++++++++++++++++++++++++++++ skills/validate-md/SKILL.md | 54 +++++++++++++++++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 plugin.lock.json create mode 100644 skills/validate-md/SKILL.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..1072c43 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "validate-md", + "description": "Validates markdown files with YAML frontmatter against JSON Schema definitions.", + "version": "0.0.0-2025.11.28", + "author": { + "name": "Matthias Luebken", + "email": "matthias@lastname.com" + }, + "skills": [ + "./skills" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2177071 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# validate-md + +Validates markdown files with YAML frontmatter against JSON Schema definitions. diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..654e4e0 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:luebken/claude-plugins:plugins/validate-md/", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "a990d543134eabcb8b3c3299eb12e3564e67cd4d", + "treeHash": "1388df4ad1acf09ee837051cd2583b66a532c5609c9b896ccccdf12ba3472b29", + "generatedAt": "2025-11-28T10:20:22.918899Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "validate-md", + "description": "Validates markdown files with YAML frontmatter against JSON Schema definitions.", + "version": null + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "3871382fed4e569889e8cd91cbcb1542bfaeb34566c9e0841ad65ef8485db0f7" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "6d723e3de6bcf44de5f26f570eee03a8f1244240bf4f83f8471ee01fba86607f" + }, + { + "path": "skills/validate-md/SKILL.md", + "sha256": "21d916481467e2010901d89ff95a0ec1a5c4c83b9b6d5d2704401731b4826018" + } + ], + "dirSha256": "1388df4ad1acf09ee837051cd2583b66a532c5609c9b896ccccdf12ba3472b29" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/validate-md/SKILL.md b/skills/validate-md/SKILL.md new file mode 100644 index 0000000..b7f6d38 --- /dev/null +++ b/skills/validate-md/SKILL.md @@ -0,0 +1,54 @@ +--- +name: validate-md +description: Validates markdown files with YAML frontmatter against JSON Schema definitions. +allowed-tools: [Bash, Read, Glob] +--- + +# Validating Markdown Files + +## Instructions + +1. **Run validation script** for the target directory containing a `schema.yaml` file: + ```bash + python validate-md.py + ``` + +2. **Review results**: + - Success: `✓ OK: filename.md is valid` + - Errors: Shows validation error, field path, and file location + +## Examples + +**Example 1: Validate contacts directory** +```bash +python validate-md.py crm/contacts +``` + +Output: +``` +✓ OK: smith-john.md is valid +✓ OK: doe-jane.md is valid +✓ SUCCESS: All 2 files are valid! +``` + +**Example 2: Validation error - missing required field** +```bash +python validate-md.py crm/opportunities +``` + +Output: +``` +❌ deal-2024-q1.md validation error: 'stage' is a required property + In file: crm/opportunities/deal-2024-q1.md +``` + +Fix: Add `stage: qualified` to the frontmatter. + +## Scripts + +- `validate-md.py` the python validation script + +## Required Python Packages + +- pyyaml - for parsing YAML frontmatter +- jsonschema - for validating against JSON Schema