fix(coding-agent): allow skill names to differ from directories

closes #4534
This commit is contained in:
Mario Zechner
2026-05-16 23:38:46 +02:00
parent d0fe8570e9
commit 5d31e70b8a
4 changed files with 8 additions and 12 deletions

View File

@@ -90,13 +90,9 @@ export interface LoadSkillsResult {
* Validate skill name per Agent Skills spec.
* Returns array of validation error messages (empty if valid).
*/
function validateName(name: string, parentDirName: string): string[] {
function validateName(name: string): string[] {
const errors: string[] = [];
if (name !== parentDirName) {
errors.push(`name "${name}" does not match parent directory "${parentDirName}"`);
}
if (name.length > MAX_NAME_LENGTH) {
errors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);
}
@@ -301,7 +297,7 @@ function loadSkillFromFile(
const name = frontmatter.name || parentDirName;
// Validate name
const nameErrors = validateName(name, parentDirName);
const nameErrors = validateName(name);
for (const error of nameErrors) {
diagnostics.push({ type: "warning", message: error, path: filePath });
}