MCPcopy
hub / github.com/garrytan/gstack / parseSkillManifest

Function parseSkillManifest

lib/gstack-memory-helpers.ts:340–348  ·  view source on GitHub ↗
(skillFilePath: string)

Source from the content-addressed store, hash-verified

338 * fields and relies on validation having already happened upstream.
339 */
340export function parseSkillManifest(skillFilePath: string): GbrainManifest | null {
341 if (!existsSync(skillFilePath)) return null;
342 const content = readFileSync(skillFilePath, "utf-8");
343 const frontmatter = extractFrontmatter(content);
344 if (!frontmatter) return null;
345 const gbrain = extractGbrainBlock(frontmatter);
346 if (!gbrain) return null;
347 return gbrain;
348}
349
350function extractFrontmatter(content: string): string | null {
351 // Supports both `---\n...\n---` (YAML) and `+++\n...\n+++` (TOML, rare).

Callers 2

loadContextFunction · 0.90

Calls 2

extractGbrainBlockFunction · 0.85
extractFrontmatterFunction · 0.70

Tested by

no test coverage detected