From 3d90028be3531d55e95828d676e828c98a3ddc13 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 12 Aug 2026 03:23:53 +0000 Subject: [PATCH] fix(docs-hygiene): Form 14 matches title-cased ATX headings Add (?i) to Form 14 ATX and Setext title alternatives so a title-case heading does not fall through to bare Form 2 with a less safe Certain classification. Declaration alternatives stay case-sensitive. Fixes #1394 Co-authored-by: Kyle Sexton --- plugins/docs-hygiene/.claude-plugin/plugin.json | 2 +- plugins/docs-hygiene/CHANGELOG.md | 9 +++++++++ .../skills/rename-references/context/audit.md | 2 ++ .../skills/rename-references/context/patterns.md | 8 ++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/plugins/docs-hygiene/.claude-plugin/plugin.json b/plugins/docs-hygiene/.claude-plugin/plugin.json index dda89640b0..f85d12e073 100644 --- a/plugins/docs-hygiene/.claude-plugin/plugin.json +++ b/plugins/docs-hygiene/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json", "name": "docs-hygiene", - "version": "0.11.1", + "version": "0.11.2", "description": "Documentation-hygiene toolkit of six skills: compress (flavor-trim markdown with a semantic-diff safety net), audit-noise (classify markdown noise), extract-ssot (deduplicate repeated content into a single source of truth), audit-encapsulation (detect citations into skill-private surfaces), rename-references (sweep stale references after renames), and audit-derivability (classify whether a whole document earns its existence — could a fresh agent re-derive it from the code?).", "author": { "name": "Melodic Software", diff --git a/plugins/docs-hygiene/CHANGELOG.md b/plugins/docs-hygiene/CHANGELOG.md index 7164b01c6e..501a4d9577 100644 --- a/plugins/docs-hygiene/CHANGELOG.md +++ b/plugins/docs-hygiene/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog — docs-hygiene plugin +## [0.11.2] + +### Fixed + +- **`rename-references` Form 14 missed title-cased ATX headings (#1394).** The ATX and Setext + title alternatives now carry `(?i)` so `# Re-Anchor` matches a container named `re-anchor` + instead of falling through to bare Form 2. Declaration alternatives stay case-sensitive; + `audit.md` warns against global `-i`. + ## [0.11.1] ### Fixed diff --git a/plugins/docs-hygiene/skills/rename-references/context/audit.md b/plugins/docs-hygiene/skills/rename-references/context/audit.md index b07caf1eff..9b490cf6da 100644 --- a/plugins/docs-hygiene/skills/rename-references/context/audit.md +++ b/plugins/docs-hygiene/skills/rename-references/context/audit.md @@ -47,6 +47,8 @@ Run all patterns from [patterns.md](patterns.md) in parallel via Grep tool. For REJECTS outright (`the literal "\n" is not allowed in a regex`). Without it the Setext pattern errors rather than under-matching, so the survey silently loses the form and a container's landing-page title survives as Form-2 residue that container mode excludes +- Form 14's ATX and Setext alternatives embed `(?i)` so title-case headings match; do **not** add + `-i` globally — declaration alternatives must stay case-sensitive (#1394) - Apply auto-exclusions per `../SKILL.md` "Auto-exclusions" via `glob` filter or post-filter **Collect per-OCCURRENCE records, not per-line ones.** `output_mode: "content"` returns matching diff --git a/plugins/docs-hygiene/skills/rename-references/context/patterns.md b/plugins/docs-hygiene/skills/rename-references/context/patterns.md index a55ffcee9d..a0fabcd6d9 100644 --- a/plugins/docs-hygiene/skills/rename-references/context/patterns.md +++ b/plugins/docs-hygiene/skills/rename-references/context/patterns.md @@ -293,8 +293,8 @@ existing "Frozen historical records" rule already excludes. See `triage.md` ## Form 14: Document title / declared name ```regex -^#{1,6}\s+`?`?\s*(#+\s*)?$ -^`?`?\s*$\n^(=+|-+)\s*$ +(?i)^#{1,6}\s+`?`?\s*(#+\s*)?$ +(?i)^`?`?\s*$\n^(=+|-+)\s*$ ^\s*(name|title|id):\s*(""|''|)(\s+#.*)?\s*$ (^|[{,])\s*"(name|title|id)"\s*:\s*""\s*(,|}|$) ^\s*"?(name|title|id)"?\s*=\s*(""|'')\s*(#.*)?$ @@ -302,6 +302,10 @@ existing "Frozen historical records" rule already excludes. See `triage.md` ``` - **Triage default:** Certain +- **Case on title shapes only:** the ATX and Setext alternatives carry a `(?i)` flag — a + title-cased heading (`# Re-Anchor` for a container named `re-anchor`) is the same reference as + a lowercase one and keeps Form 14's scope rule. Declaration alternatives stay case-sensitive: + manifest and catalog registrations are exact identifiers (#1394). - **Catches:** an ATX heading whose ENTIRE content is the renamed token — the README H1 that names the thing — a `name` / `title` / `id` declaration in YAML frontmatter, a JSON manifest or catalog, or a TOML manifest — and a catalog entry KEYED by the container rather than declaring