mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 06:06:37 +03:00
Allow XML-block prose form in SKILL.md DON'T parser
Recognize "DO NOT" / "DO" lines (with optional colon) inside <rules> and <absolute_bans> blocks, and make skillGuideline substring matching case-insensitive so the validator handles the new XML-structured SKILL.md without rejecting the refactored prose. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
282987ad7b
commit
0728eaadea
+8
-4
@@ -122,10 +122,14 @@ function validateAntipatternRules(rootDir) {
|
||||
const antipatterns = new Function(`return [${apMatch[1]}]`)();
|
||||
const { antipatterns: skillSections } = readPatterns(rootDir);
|
||||
|
||||
// Build section -> joined-DON'T-text lookup for substring matching
|
||||
// Build section -> joined-DON'T-text lookup for substring matching.
|
||||
// Lowercased for case-insensitive matching: my XML refactor uses sentence-
|
||||
// case "DO NOT nest cards" while the rules' skillGuideline strings are
|
||||
// sentence-cased "Nest cards inside cards" (a fragment from the original
|
||||
// markdown bullet "**DON'T**: Nest cards inside cards.").
|
||||
const sectionText = {};
|
||||
for (const section of skillSections) {
|
||||
sectionText[section.name] = section.items.join('\n');
|
||||
sectionText[section.name] = section.items.join('\n').toLowerCase();
|
||||
}
|
||||
|
||||
let errors = 0;
|
||||
@@ -143,8 +147,8 @@ function validateAntipatternRules(rootDir) {
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
if (!text.includes(rule.skillGuideline)) {
|
||||
console.error(` ❌ Rule '${rule.id}': skillGuideline '${rule.skillGuideline}' not found in any **DON'T** of section '${rule.skillSection}' in source/skills/impeccable/SKILL.md`);
|
||||
if (!text.includes(rule.skillGuideline.toLowerCase())) {
|
||||
console.error(` ❌ Rule '${rule.id}': skillGuideline '${rule.skillGuideline}' not found in any DON'T of section '${rule.skillSection}' in source/skills/impeccable/SKILL.md`);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user