{"record":{"id":"3c08f650335d2316","repo":"iOfficeAI/OfficeCLI","slug":"embedded-skill-md-not-found-for-skillname","errorCode":null,"errorMessage":"Embedded SKILL.md not found for '{skillName}'","messagePattern":"Embedded SKILL\\.md not found for '(.+?)'","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"critical","filePath":"src/officecli/Core/SkillInstaller.cs","lineNumber":249,"sourceCode":"    }\n\n    /// <summary>All known skill aliases, sorted, comma-joined for error messages.</summary>\n    public static string KnownSkillsList() => string.Join(\", \", SkillMap.Keys.OrderBy(k => k));\n\n    /// <summary>\n    /// Return the embedded SKILL.md content for <paramref name=\"skillName\"/> with\n    /// no side-effects and no stdout writes. Throws <see cref=\"ArgumentException\"/>\n    /// on unknown skill or missing embedded resource. Used by both the CLI\n    /// `officecli load_skill &lt;name&gt;` command and the MCP `load_skill` tool —\n    /// shared so the two surfaces have identical semantics.\n    /// </summary>\n    public static string LoadSkillContent(string skillName)\n    {\n        if (!SkillMap.TryGetValue(skillName, out var folder))\n            throw new ArgumentException($\"Unknown skill: {skillName}. Available: {KnownSkillsList()}\");\n        var content = LoadEmbeddedResource($\"skills/{folder}/SKILL.md\");\n        if (content == null)\n            throw new ArgumentException($\"Embedded SKILL.md not found for '{skillName}'\");\n        // A SKILL.md is an entry point that defers detail to bundled reference\n        // files (reference/*.md, helper scripts, style libraries). Append a\n        // manifest so a text-channel caller (MCP / CLI, no skill install) knows\n        // those files exist and how to fetch them — otherwise every\n        // \"see reference/foo\" pointer in the body is a dead link.\n        return StripSetupSection(content) + BuildReferenceManifest(skillName);\n    }\n\n    /// <summary>\n    /// Relative paths of every embedded file for a skill except SKILL.md,\n    /// sorted. Uses resource names only (no content read) so binary assets are\n    /// listed without being mangled.\n    /// </summary>\n    public static IReadOnlyList<string> ListSkillFiles(string skillName)\n    {\n        if (!SkillMap.TryGetValue(skillName, out var folder))\n            throw new ArgumentException($\"Unknown skill: {skillName}. Available: {KnownSkillsList()}\");\n        var prefix = $\"skills/{folder}/\";","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/SkillInstaller.cs#L231-L267","documentation":"Thrown by LoadSkillContent after the skill name resolved to a folder, but LoadEmbeddedResource returned null for skills/<folder>/SKILL.md — the embedded resource is missing. This is a build/packaging defect, not a user input error: the SkillMap entry exists but the corresponding SKILL.md was not embedded at build time. ArgumentException.","triggerScenarios":"SkillMap contains the skill (so the name check passes) but the embedded resource 'skills/<folder>/SKILL.md' is absent from the assembly. Indicates the .csproj embedded-resource glob excluded or missed the file.","commonSituations":"A skill folder was added to SkillMap but its SKILL.md was not marked as an embedded resource, the file was renamed/moved without updating the build, or a clean/rebuild left resources stale.","solutions":["Confirm skills/<folder>/SKILL.md exists on disk and is included as an embedded resource in the .csproj.","Rebuild the assembly and verify via GetManifestResourceNames() that the resource is present.","Ensure the folder name in SkillMap matches the on-disk/embedded folder exactly."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Sanity-check the embedded resource exists (dev/build hygiene)\nvar present = Assembly.GetExecutingAssembly().GetManifestResourceNames()\n    .Any(n => n.EndsWith(\"skills/<folder>/SKILL.md\", StringComparison.OrdinalIgnoreCase));\nif (!present) /* fix .csproj embedded resource glob */","typeGuard":null,"tryCatchPattern":"try { var content = SkillInstaller.LoadSkillContent(skillName); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Embedded SKILL.md not found\"))\n{ /* build/packaging defect: rebuild after fixing embedded-resource config */ }","preventionTips":["Mark every skills/<folder>/SKILL.md as an embedded resource in the .csproj.","Add a unit test asserting each SkillMap entry has its SKILL.md embedded.","Rebuild cleanly after adding/renaming skill folders."],"tags":["skills","embedded-resource","build","packaging-defect"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}