bundle-and-verify
暂无简介
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 8
- Forks
- 1
03 SKILL.md 正文
Before You Start
bundle.sh— the bundler; embeds alllib/,prompts/,schemas/,scripts/as heredocsMakefile—bundleandcleantargetsdist/ultrainit.sh— the output artifact (gitignored).github/workflows/release.yml— runsbash bundle.sh > dist/ultrainit.shat release time
Steps
1. Run quality checks first
make check
Do not build a bundle from code that fails syntax checks.
2. Check for delimiter conflicts
bundle.sh embeds files as heredocs with __EOF_LIB_<name>__ delimiters. If any embedded file contains this exact pattern on a line, the heredoc terminates early:
grep -rn '__EOF_LIB_' lib/ scripts/ prompts/ schemas/ 2>/dev/null
If any matches are found, the files with those matches cannot be safely bundled until the pattern is removed.
3. Build the bundle
mkdir -p dist
bash bundle.sh > dist/ultrainit.sh
chmod +x dist/ultrainit.sh
Critical: bundle.sh must write ONLY bundle content to stdout. Any echo, log_*, or debug output in bundle.sh corrupts the bundle. The release.yml workflow does bash bundle.sh > dist/ultrainit.sh — spurious stdout becomes part of the script.
4. Syntax-check the bundle
bash -n dist/ultrainit.sh && echo "syntax OK"
Failure here usually means a heredoc delimiter collision or a syntax error introduced during bundling.
5. Check bundle size
du -sh dist/ultrainit.sh
wc -l dist/ultrainit.sh
Expected range: 2,000-8,000 lines depending on prompt and schema content. A dramatically smaller bundle (< 1,000 lines) suggests a delimiter collision truncated the output.
6. Test self-extraction
# Test --help in an isolated tmpdir
tmpdir=$(mktemp -d)
bash dist/ultrainit.sh --help
rm -rf "$tmpdir"
Self-extraction should emit the usage message without error.
7. Clean up
make clean # removes dist/ultrainit.sh
Or keep dist/ultrainit.sh if you need it for manual testing.
Verify
bash -n dist/ultrainit.sh # syntax
du -sh dist/ultrainit.sh # size sanity
bash dist/ultrainit.sh --help # self-extraction
Common Mistakes
-
Forgetting
stdoutpurity inbundle.sh— any diagnostic output inbundle.shcorrupts the artifact. The bundle is always produced via stdout redirect (bash bundle.sh > dist/ultrainit.sh), so stdout is the output. -
Skipping the delimiter conflict check — low probability but high impact. A match produces a silently truncated bundle that passes
bash -non the truncated portion but fails at runtime when trying to source missing content. -
Not running
make checkfirst —bash -n dist/ultrainit.shonly checks the bundle's wrapper script syntax, not the syntax of embedded files. Catch embedded syntax errors withmake checkbefore bundling.
04 同仓库更多 Skills
valid-skill
Use when building or modifying API endpoints in src/api/. Covers route creation, middleware wiring, and request validation. Do NOT use for frontend components or static pages.
invalid-skill-no-desc
暂无简介
invalid-skill-angle-brackets
Use when working with <component> templates. Do NOT use for <other> things.
validate-generated-artifact
暂无简介
tune-synthesis-context
暂无简介
run-tests
暂无简介