Merge pull request 'fix(skills): write BOMs as escape sequences so apm audit stops flagging them' (#232) from fix/apm-hidden-chars-208 into main
Reviewed-on: #232
This commit was merged in pull request #232.
This commit is contained in:
commit
92d39ae1f9
4 files changed
+5
-5
No files matched your search
@@ -298,14 +298,14 @@ EOF
|
||||
|
||||
@test "a doubled UTF-8 BOM does not hide the @import line" {
|
||||
ADAPTER="$TMPDIR/CLAUDE.md"
|
||||
python3 -c "import sys; open(sys.argv[1], 'wb').write(('@AGENTS.md\n').encode('utf-8'))" "$ADAPTER"
|
||||
python3 -c "import sys; open(sys.argv[1], 'wb').write(('\ufeff\ufeff@AGENTS.md\n').encode('utf-8'))" "$ADAPTER"
|
||||
run bash "$SCRIPT" "$ADAPTER" "$AGENTS_MD"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "a BOM in front of a mid-file @import line does not hide it" {
|
||||
ADAPTER="$TMPDIR/CLAUDE.md"
|
||||
python3 -c "import sys; open(sys.argv[1], 'wb').write(('# Claude notes\n\n@AGENTS.md\n').encode('utf-8'))" "$ADAPTER"
|
||||
python3 -c "import sys; open(sys.argv[1], 'wb').write(('# Claude notes\n\n\ufeff@AGENTS.md\n').encode('utf-8'))" "$ADAPTER"
|
||||
run bash "$SCRIPT" "$ADAPTER" "$AGENTS_MD"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ description: >
|
||||
fixes -> agent-author.
|
||||
allowed-tools: Bash Read
|
||||
metadata:
|
||||
version: "1.0.6"
|
||||
version: "1.0.7"
|
||||
category: factory
|
||||
source_keys:
|
||||
- agentskills-home
|
||||
|
||||
@@ -1055,7 +1055,7 @@ FRONTMATTER_RE = re.compile(
|
||||
|
||||
|
||||
def strip_bom(text):
|
||||
return text[1:] if text.startswith(u'') else text
|
||||
return text[1:] if text.startswith(u'\ufeff') else text
|
||||
|
||||
|
||||
class FrontmatterError(Exception):
|
||||
|
||||
@@ -85,7 +85,7 @@ fm_lines = ['name: ' + name, 'description: ' + desc]
|
||||
if kind == 'plain':
|
||||
pass
|
||||
elif kind == 'bom':
|
||||
prefix = ''
|
||||
prefix = '\ufeff'
|
||||
elif kind == 'leading-blanks':
|
||||
prefix = '\n\n \n'
|
||||
elif kind == 'trailing-ws':
|
||||
|
||||
Reference in new issue
Block a user