Skip to content

fix(skill_engine): keep SKILL.md when *** File: appears in prose#105

Open
santhreal wants to merge 2 commits into
HKUDS:mainfrom
santhreal:fix/detect-patch-type-single-file
Open

fix(skill_engine): keep SKILL.md when *** File: appears in prose#105
santhreal wants to merge 2 commits into
HKUDS:mainfrom
santhreal:fix/detect-patch-type-single-file

Conversation

@santhreal

Copy link
Copy Markdown

Problem

A skill body that mentions a single mid-document *** File: line (for example inside an example) was parsed as multi-file FULL output. create_skill then wrote only that file and never created SKILL.md.

Repro

from pathlib import Path
from openspace.skill_engine.patch import create_skill

content = "# My Skill\n\n*** File: helper.sh\n#!/bin/bash\necho hi\n"
create_skill(Path("/tmp/s"), content)
# helper.sh exists; SKILL.md does not

Fix

Align detect_patch_type with its docstring (≥2 markers, or one at content start with a body). For a single mid-document *** File:, parse_multi_file_full keeps the whole content as SKILL.md.

A single mid-document *** File: marker was treated as multi-file FULL
output, so create_skill wrote only the spurious file and dropped SKILL.md.
Match the detect_patch_type docstring: require two markers or one at the
start with a body, and keep whole-content SKILL.md for mid-doc singles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant