mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-06 21:46:40 +02:00
fix: generate .agents directory at setup time instead of shipping duplicates (#308)
Removes 14K+ lines of committed generated Codex skill files from git. .agents/ is now gitignored and generated at setup time via `bun run gen:skill-docs --host codex`. Updates CI workflow to validate generation instead of checking committed file freshness. Co-authored-by: cskwork <cskwork@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,27 @@ if [ ! -x "$BROWSE_BIN" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 1b. Generate .agents/ Codex skill docs if missing or stale
|
||||
# .agents/ is no longer committed — generated at setup time from .tmpl templates.
|
||||
# bun run build already does this, but we need it when NEEDS_BUILD=0 (binary is fresh
|
||||
# but .agents/ hasn't been generated yet, e.g., fresh clone).
|
||||
AGENTS_DIR="$GSTACK_DIR/.agents/skills"
|
||||
NEEDS_AGENTS_GEN=0
|
||||
if [ ! -d "$AGENTS_DIR" ]; then
|
||||
NEEDS_AGENTS_GEN=1
|
||||
elif [ -n "$(find "$GSTACK_DIR" -maxdepth 2 -name 'SKILL.md.tmpl' -newer "$AGENTS_DIR" -print -quit 2>/dev/null)" ]; then
|
||||
NEEDS_AGENTS_GEN=1
|
||||
fi
|
||||
|
||||
if [ "$NEEDS_AGENTS_GEN" -eq 1 ] && [ "$NEEDS_BUILD" -eq 0 ]; then
|
||||
echo "Generating .agents/ skill docs..."
|
||||
(
|
||||
cd "$GSTACK_DIR"
|
||||
bun install --frozen-lockfile 2>/dev/null || bun install
|
||||
bun run gen:skill-docs --host codex
|
||||
)
|
||||
fi
|
||||
|
||||
# 2. Ensure Playwright's Chromium is available
|
||||
if ! ensure_playwright_browser; then
|
||||
echo "Installing Playwright Chromium..."
|
||||
@@ -166,7 +187,12 @@ link_codex_skill_dirs() {
|
||||
local linked=()
|
||||
|
||||
if [ ! -d "$agents_dir" ]; then
|
||||
echo " warning: no .agents/skills/ directory found — run 'bun run build' first" >&2
|
||||
echo " Generating .agents/ skill docs..."
|
||||
( cd "$gstack_dir" && bun run gen:skill-docs --host codex )
|
||||
fi
|
||||
|
||||
if [ ! -d "$agents_dir" ]; then
|
||||
echo " warning: .agents/skills/ generation failed — run 'bun run gen:skill-docs --host codex' manually" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user