fix(scripts): port skill-catalog generator off gawk-only awk -v (ag-mm6q #bsd-awk-portability)#784
Open
boshu2 wants to merge 1 commit into
Open
fix(scripts): port skill-catalog generator off gawk-only awk -v (ag-mm6q #bsd-awk-portability)#784boshu2 wants to merge 1 commit into
boshu2 wants to merge 1 commit into
Conversation
…m6q #bsd-awk-portability)
generate-skill-catalog.sh passed the YAML frontmatter into awk via
`awk -v fm="$fm"`. A literal newline inside a `-v var=value` assignment is
accepted only by GNU awk; BSD/POSIX awk (macOS without gawk) errors with
"awk: newline in string ..." and emits no catalog, so the catalog could only
be regenerated inside Linux CI.
Feed the frontmatter on stdin and accumulate input lines into lines[]
(processed in END exactly as before) instead of -v + split(). Pure
input-mechanism change; the parse logic is untouched.
Verified on macOS BSD awk (version 20200816): --stdout now emits valid JSON
for all 81 skills, lists + context_rel + quoted descriptions parse correctly
(e.g. deps -> context_rel [{kind: supplier-to, with: vibe}] matches source).
Added an explicit BSD/POSIX-awk regression test; full bats suite 15/15 green.
The committed skills/catalog.json is independently stale (75 vs 81 skills);
regenerating it is left to the Linux-CI drift path (I0 advisory, non-blocking)
to avoid committing a glob-order-sensitive artifact generated off-CI.
Closes-scenario: ag-mm6q#bsd-awk-portability
Bounded-context: BC2-Validation
Evidence: tests/scripts/generate-skill-catalog.bats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
scripts/generate-skill-catalog.shpassed the YAML frontmatter into awk viaawk -v fm="$fm". A literal newline inside a-v var=valueassignment is accepted only by GNU awk; BSD/POSIX awk (macOS without gawk) errors withawk: newline in string ...and emits no catalog — so the catalog (and its drift gatecheck-skill-catalog-drift.sh) could only run inside Linux CI.Fix
Feed the frontmatter on stdin and accumulate input lines into
lines[](processed inENDexactly as before) instead of-v+split(). Pure input-mechanism change — the parse logic is untouched.Evidence (macOS BSD awk, version 20200816)
bash scripts/generate-skill-catalog.sh --stdout→awk: newline in string name: agent-native(no output).context_rel, and quoted descriptions parse correctly (e.g.deps→context_rel: [{kind: supplier-to, with: vibe}], matching the source SKILL.md).multi-line frontmatter parses ... without 'newline in string'). Full bats suite 15/15 green on macOS.shellcheckclean.Scope note
The committed
skills/catalog.jsonis independently stale (75 vs 81 skills — drift predates this change, since the generator never ran off-Linux). Regenerating it is deliberately left to the Linux-CI drift path (thecheck skill catalog driftjob is I0 advisory / non-blocking) to avoid committing a glob-order-sensitive artifact generated off-CI.Closes-scenario: ag-mm6q#bsd-awk-portability
Bounded-context: BC2-Validation
Evidence: tests/scripts/generate-skill-catalog.bats