fix: stop mode filter stripping rule bullets with a colon
filterSkillBodyForMode only filters lines whose label is a real mode (lite/full/ultra). Rule bullets like 'No unrequested abstractions:' and the 'ponytail:' comment convention were being stripped from injected instructions in every mode. Adds regression test.
This commit is contained in:
@@ -66,3 +66,20 @@ test("filterSkillBodyForMode keeps only requested intensity examples and rows",
|
||||
assert.ok(filtered.includes("Ultra example"));
|
||||
assert.ok(filtered.includes("Other line"));
|
||||
});
|
||||
|
||||
test("filterSkillBodyForMode keeps rule bullets that contain a colon", () => {
|
||||
// Regression: rule bullets outside the Intensity section (e.g. the
|
||||
// "No unrequested abstractions:" rule or the `ponytail:` comment convention)
|
||||
// contain a colon and must not be mistaken for mode-example lines.
|
||||
const skillPath = join(import.meta.dirname, "..", "..", "skills", "ponytail", "SKILL.md");
|
||||
const body = readFileSync(skillPath, "utf8");
|
||||
|
||||
const filtered = filterSkillBodyForMode(body, "full");
|
||||
|
||||
assert.ok(filtered.includes("No unrequested abstractions"));
|
||||
assert.ok(filtered.includes("Mark deliberate simplifications"));
|
||||
// The Intensity examples are still filtered down to the active mode.
|
||||
assert.ok(filtered.includes('full: "`@lru_cache'));
|
||||
assert.ok(!filtered.includes('lite: "Done'));
|
||||
assert.ok(!filtered.includes('ultra: "No cache'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user