-
Load the applicable repo instructions:
.github/instructions/page-description-frontmatter.instructions.md
.github/instructions/content-language.instructions.md
-
Run the metadata scanner over the requested target. Use the repo script for the default all-posts scan, or the script directly for a narrower target:
pnpm run metadata:scan
pnpm run metadata:scan --hard-only --summary
node .agents/skills/update-page-metadata/scripts/scan-post-metadata.mjs src/posts/2005
-
Inspect candidates before editing. Use the context extractor for a compact view of frontmatter plus the opening body text:
node .agents/skills/update-page-metadata/scripts/get-post-metadata-context.mjs src/posts/2005 --only-issues
-
Decide whether each candidate truly needs a fix:
| Condition | Action | Notes |
|---|
| Missing title or description, title under 15 characters, description under 25 characters, placeholder metadata, commented-out metadata, description repeating the title, description copied from old link text, vague description, or description that does not stand alone. | Fix. | Treat these as hard metadata quality issues. |
| Title over 70 characters, description over 160 characters when the user asks to fix a folder or year. | Fix after hard issues are clean. | This takes precedence over leaving accurate historical notes alone; shorten while preserving specificity and accuracy. |
| Accurate, specific, useful historical note with metadata inside the required limits. | Usually leave alone. | Do not rewrite solely to reach 150-160 characters. |
-
Draft replacements from the actual post content, not just the filename.
-
Apply changes with the JSON apply script for any batch or any older imported Blogger post. Use apply_patch only for one or two simple, freshly inspected files:
node .agents/skills/update-page-metadata/scripts/apply-post-metadata.mjs metadata-updates.json
-
Immediately validate hard failures after each edit batch before making more edits. Hard failures include short titles, short descriptions, and repeated-title descriptions; long descriptions are advisory:
node .agents/skills/update-page-metadata/scripts/scan-post-metadata.mjs src/posts/2005 --hard-only --strict
If any script exits with a non-zero code or reports an error, stop the workflow, report the exact error output to the user, and do not proceed to the next step until the issue is resolved.
-
Run full advisory validation when the hard-failure check is clean:
node .agents/skills/update-page-metadata/scripts/scan-post-metadata.mjs src/posts/2005 --strict
If this reports only description.long issues and the user asked to fix the target folder/year, do a second reviewed JSON batch to shorten those descriptions, then rerun the full strict scan.
-
Remove temporary JSON update files once they have been applied and validated.
-
Run frontmatter and Markdown validation on the edited scope:
pnpm run validate-frontmatter
pnpm exec markdownlint-cli2 "src/posts/2005/**/*.md"
-
Run diagnostics on edited files or folders with the editor error tool when available.
Only include fields that should change. The script refuses to edit files without valid opening and closing frontmatter delimiters.
If the apply script skips a file due to missing frontmatter delimiters, flag it to the user with the file path and do not attempt a manual patch without first verifying and repairing the delimiters.