fix: preserve article casing in prefixed skill references

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Gujiassh
2026-03-19 11:52:26 +09:00
co-authored by Sisyphus
parent d6b1a56bc5
commit b1becfc341
2 changed files with 6 additions and 4 deletions
+4 -1
View File
@@ -331,7 +331,10 @@ export function prefixSkillReferences(content, prefix, skillNames) {
result = result.replace(new RegExp(`\\/(?=${escapeRegex(name)}(?:[^a-zA-Z0-9_-]|$))`, 'g'), `/${prefix}`);
// Replace `the skillname skill` references
result = result.replace(new RegExp(`the ${escapeRegex(name)} skill`, 'gi'), `the ${prefixed} skill`);
result = result.replace(
new RegExp(`(the) ${escapeRegex(name)} skill`, 'gi'),
(_, article) => `${article} ${prefixed} skill`
);
}
return result;