{"record":{"id":"3b630ece3d074b26","repo":"multica-ai/multica","slug":"create-skills-dir-w","errorCode":null,"errorMessage":"create skills dir: %w","messagePattern":"create skills dir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/execenv/context.go","lineNumber":940,"sourceCode":"// writeSkillFiles writes skill directories into the given parent directory.\n// Each skill gets its own subdirectory containing SKILL.md and supporting\n// files. manifest, when non-nil, is populated with every newly-created\n// directory and file so CleanupSidecars can remove them on\n// local_directory teardown without touching user-owned skill directories\n// that happen to live alongside ours under the same skills/ parent.\n//\n// When a Multica skill's natural slug collides with a user-installed\n// skill at the same path, we allocate a collision-free sibling slug\n// (e.g. `issue-review-multica`) and write there instead. Provider-native\n// discovery still picks it up because every subdir under skillsDir is a\n// distinct skill; the user's original directory stays bit-for-bit\n// intact. Without this fallback writeSkillFiles would have to either\n// overwrite user bytes (the bug PR #3444 review caught) or skip the\n// skill entirely (which would silently drop a Multica skill the agent\n// expects to see).\nfunc writeSkillFiles(skillsDir string, skills []SkillContextForEnv, manifest *sidecarManifest) error {\n\tif err := recordMkdirAll(skillsDir, 0o755, manifest); err != nil {\n\t\treturn fmt.Errorf(\"create skills dir: %w\", err)\n\t}\n\n\t// resolveSkillSlugs deduplicates within the batch first, so two skills whose\n\t// names sanitize alike (\"A B\" / \"A-B\") get distinct bases here instead of\n\t// racing for the same directory. The listings derive from the same function,\n\t// which is what keeps them naming the directories this loop creates.\n\t// allocateCollisionFreeSkillDir still runs on top, for collisions against\n\t// directories we did not write (user-installed skills).\n\tbatchSlugs := resolveSkillSlugs(skills)\n\n\tfor i, skill := range skills {\n\t\tslug, dir, err := allocateCollisionFreeSkillDir(skillsDir, batchSlugs[i])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"allocate skill dir for %q: %w\", skill.Name, err)\n\t\t}\n\t\tif err := recordMkdirAll(dir, 0o755, manifest); err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":922,"sourceCodeEnd":958,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/execenv/context.go#L922-L958","documentation":"Error \"create skills dir: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/daemon/execenv/context.go:940 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check permissions to create the skills directory."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}