Scan a target folder for YAML frontmatter violations: wrong type values, non-standard subtypes, missing required fields (related, status, modified), and type mismatches between note content and classification. Use when [OWNER] says "yaml-graph-audit", "audit YAML", "fix frontmatter", "fix the graph", "check YAML in [folder]", or after any bulk processing operation (inbox processing, batch import, G5.QC-style remediation). Outputs a violations report, fixes all auto-fixable issues, and flags manual-review items.
Installation
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Scan a target folder for YAML frontmatter violations: wrong type values, non-standard subtypes, missing required fields (related, status, modified), and type mismatches between note content and classification. Use when [OWNER] says "yaml-graph-audit", "audit YAML", "fix frontmatter", "fix the graph", "check YAML in [folder]", or after any bulk processing operation (inbox processing, batch import, G5.QC-style remediation). Outputs a violations report, fixes all auto-fixable issues, and flags manual-review items.
argument-hint
folder path to audit (e.g. 05-knowledge/permanent-notes/ or 06-resources/)
Finds and fixes YAML frontmatter violations across a folder — the recurring quality-control step that caught 61 misclassified notes in G5.QC. Run after any bulk operation to ensure the Obsidian graph stays clean and wikilinks resolve correctly.
━━━
Scope
This skill operates on the folder [OWNER] specifies (default: entire vault except .obsidian/).
06-resources/ — external content, social captures, reference docs
system
01-systems/ — CKIS architecture, workflows, tools
daily
02-daily/ — daily notes and session logs
project
03-projects/ — active project files
archive-note
11-archive/ — retrospective documentation created about a past venture or project (distinct from project files that were merely moved to archive, which keep type: project)
Category A — Wrong type for location (e.g., type: permanent-note in 06-resources/):
These are routing errors — the note is in the wrong folder OR has the wrong type
Category B — Missing required fields:
Missing type, created, modified, or status
Category C — Non-standard values:
type: permanent-notes (plural) vs type: permanent-note (singular)
subtype: social-capture-processed instead of subtype: social-capture
tags as string instead of array
Category D — Social capture missing processing: index-only:
Any type: resource, subtype: social-capture file missing this field
Report the manifest before making any changes:
Audit target: {folder}
Files scanned: {N}
Category A — Wrong type for location: {count}
Category B — Missing required fields: {count}
Category C — Non-standard values: {count}
Category D — Social capture missing processing field: {count}
Total violations: {total}
If total = 0: "No violations found. YAML graph is clean." Stop.
━━━
Phase 2: Auto-Fix (safe corrections)
Only auto-fix violations where the correct value is unambiguous. Flag everything else for manual review.
⚠️ Confirm with [OWNER] before touching >10 files.
Category B — Add missing required fields (safe to auto-fix):
status: if missing, add status: draft
modified: if missing, add today's date
created: if missing, use file creation mtime (via Bash: stat -c %y {file})
Do NOT auto-add type — type requires human judgment
Category C — Fix non-standard values (safe to auto-fix):
Fix via Edit — surgical replacement, preserve all surrounding content
Category D — Add processing: index-only to social captures (safe to auto-fix):
Only add if type: resource AND subtype: social-capture AND processing: is missing
Insert after the subtype: line
For each auto-fixed file: update modified: to today's date.
Log each fix: {filename} — {what was fixed}
━━━
Phase 3: Flag Manual-Review Items
For Category A (wrong type for location):
Do NOT auto-fix — moving a file or changing its type is a semantic decision
Surface to [OWNER] with the diagnosis:
MANUAL REVIEW: {filename}
Location: {current path}
Current type: {type}
Issue: {why this is a mismatch}
Options:
A) Move file to {correct path} (keep type)
B) Change type to {correct type} (keep location)
For any file where the correct value is genuinely ambiguous:
List it under "Manual Review Required" with the question [OWNER] needs to answer
━━━
Phase 4: Verify and Report
Re-run the scan on auto-fixed files to confirm violations are resolved.
Phase 3: No Category A issues (all in correct folder)
Phase 4: Report + 0 manual items
Example 2 — [OWNER] says "yaml-graph-audit 05-knowledge/permanent-notes/" after a batch import:
Phase 1: 90 files scanned. Finds 5 with type: resource (wrong — they're in permanent-notes)
Phase 2: Auto-fixes Category B+C+D only
Phase 3: Surfaces 5 Category A items for [OWNER]'s decision
Phase 4: Report with 5 manual items
━━━
Troubleshooting
File has no YAML frontmatter at all: Flag as Category B. Do NOT auto-add full frontmatter — surface to [OWNER]: "This file has no frontmatter. What type and status should it have?"
Large folder (>100 files): Process in batches of 25. Report after each batch. Continue unless [OWNER] says to stop.
Conflicting signals (e.g., file in 06-resources/ but tagged permanent-note): Treat as Category A. Surface both possible interpretations to [OWNER].