MCPcopy Index your code
hub / github.com/garrytan/gstack / validateSkillName

Function validateSkillName

browse/src/browser-skill-write.ts:36–45  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

34const SKILL_NAME_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
35
36export function validateSkillName(name: string): void {
37 if (!name) throw new Error('Skill name is empty.');
38 if (name.length > 64) throw new Error(`Skill name too long (${name.length} > 64).`);
39 if (!SKILL_NAME_PATTERN.test(name)) {
40 throw new Error(
41 `Invalid skill name "${name}". Must be lowercase letters/digits/dashes, ` +
42 `start with a letter, no leading/trailing/consecutive dashes.`,
43 );
44 }
45}
46
47// ─── Staging ────────────────────────────────────────────────────
48

Callers 3

stageSkillFunction · 0.85
commitSkillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected