Skip to content

The meta-skill that builds and improves all your skills, including itself. Watches your work sessions (autonomous or human-led), captures patterns, corrections and judgement calls, and turns them into skill improvements and new skill candidates for your review. Practical application of the Augmented Expertise methodology. Open source: CC BY 4.0.

Validator: accept a quoted name when PyYAML is absent

Eoghan Henn8ef3eb8967ee
diff --git a/.github/workflows/release-bundle.yml b/.github/workflows/release-bundle.yml
index b449652..d70880e 100644
--- a/.github/workflows/release-bundle.yml
+++ b/.github/workflows/release-bundle.yml
@@ -17,6 +17,8 @@ jobs:
cp SKILL.md /tmp/bundle/task-observer/
cp -r references scripts /tmp/bundle/task-observer/
python3 scripts/validate-skill-bundle.py /tmp/bundle/task-observer --pack /tmp/bundle/task-observer.skill
+ # Same bundle, PyYAML forced absent: the fallback branch must pass what the parser passes
+ python3 -c "import sys, runpy; sys.modules['yaml'] = None; sys.argv = ['validate-skill-bundle.py', '/tmp/bundle/task-observer']; runpy.run_path('scripts/validate-skill-bundle.py', run_name='__main__')"
- name: Attach to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/scripts/validate-skill-bundle.py b/scripts/validate-skill-bundle.py
index 9c85583..3028208 100644
--- a/scripts/validate-skill-bundle.py
+++ b/scripts/validate-skill-bundle.py
@@ -179,8 +179,9 @@ def read_core_ceiling(skill_md):
if m:
km = re.search(r"(?m)^%s:\s*(\S+)\s*$" % CORE_CEILING_KEY, m.group(1))
if km:
- if km.group(1).isdigit():
- return int(km.group(1))
+ v = km.group(1).strip("\"'") # a quoted number is still the number
+ if v.isdigit():
+ return int(v)
print(f"note: {CORE_CEILING_KEY} is not a whole number "
f"({km.group(1)!r}) — core size not gated")
return None
@@ -376,8 +377,14 @@ def check_dir(skill_dir, fails):
data = {}
except ImportError:
yaml_available = False
- data = {"name": (re.search(r"(?m)^name:\s*(.+)$", fm) or [None, ""])[1].strip(),
- "description": folded_description(fm)}
+ # Strip one layer of matching surrounding quotes: the template asks
+ # for `name: "x"`, a real parser never sees the quote characters as
+ # part of the value, and .strip() removes whitespace, not quotes —
+ # so the hardened fallback failed the bundle it ships inside.
+ raw = (re.search(r"(?m)^name:\s*(.+)$", fm) or [None, ""])[1].strip()
+ if len(raw) >= 2 and raw[0] == raw[-1] and raw[0] in "\"'":
+ raw = raw[1:-1]
+ data = {"name": raw, "description": folded_description(fm)}
except Exception as e: # yaml error
# Name the cause the check can detect, not the first field it then
# fails to find: an unquoted `: ` inside a description is the common