Route skill pre-flight through Makefile to avoid hardcoded Python

Codex users hit `python: command not found` on the welcome-flow
pre-flight because SKILL.md called `python tools/kb_freshness.py`
directly. Any hardcoded version (python/python3/python3.12) breaks
for somebody — users have 3.8, 3.10, 3.11, 3.12 in the wild.

Fix: channel all skill-initiated Python calls through `make` targets
so the Makefile's single $(PYTHON) variable (auto-detected venv >
3.12 > 3.11 > 3.10 > python3) is the only place Python resolution
lives.

- Makefile: add `kb-check` target emitting JSON for the skill pre-flight
- SKILL.md + .agents/skills/.../SKILL.md: call `make kb-check` and
  `make freshness-refresh` instead of bare `python tools/...`
- CLAUDE.md: same fix in the Welcome Flow instructions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
root
2026-04-14 12:06:15 -03:00
parent 98cb570e96
commit 7cfb5dce2d
4 changed files with 11 additions and 8 deletions

View File

@@ -43,7 +43,7 @@ If the command fails (not a git repo, no network, MCP deployment), silently skip
#### Check 3: KB freshness
Run `python3 tools/kb_freshness.py --check --json 2>/dev/null` and parse the JSON output. Behavior:
Run `make kb-check 2>/dev/null` and parse the JSON output. Behavior:
- **`stale_count == 0`** → no banner.
- **`stale_count > 0` and at least one file has `refreshable: true`** → prepend banner and ask inline:
@@ -53,8 +53,8 @@ Run `python3 tools/kb_freshness.py --check --json 2>/dev/null` and parse the JSO
<M> can be auto-refreshed. Refresh now? [y/N]
```
- `y` / `yes` / `` → run `python3 tools/kb_freshness.py --auto-refresh`, then show menu.
- Anything else → show menu with one-line reminder: `⚠️ <N> KB file(s) stale — run python3 tools/kb_freshness.py --auto-refresh later.`
- `y` / `yes` / `` → run `make freshness-refresh`, then show menu.
- Anything else → show menu with one-line reminder: `⚠️ <N> KB file(s) stale — run make freshness-refresh later.`
- **`stale_count > 0` but no `refreshable: true`** → non-blocking info banner, then show menu directly:
@@ -62,7 +62,7 @@ Run `python3 tools/kb_freshness.py --check --json 2>/dev/null` and parse the JSO
⚠️ KB freshness: <N> file(s) need manual review (oldest: <file> — <age_days>d).
```
If `kb_freshness.py` errors out (exit ≠ 0, missing python, missing tool), **silently skip** — no error output, no banner, no mention of failure.
If `make kb-check` errors out (exit ≠ 0, missing make, missing Python, missing tool), **silently skip** — no error output, no banner, no mention of failure.
### Welcome Message