Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:38:23 +08:00
commit 995d711c09
4 changed files with 114 additions and 0 deletions

View File

@@ -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"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# validate-md
Validates markdown files with YAML frontmatter against JSON Schema definitions.

45
plugin.lock.json Normal file
View File

@@ -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": []
}
}

View File

@@ -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 <directory>
```
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