fix(config): resolve Python reliably, add command-safety hook, harden CI

- Resolve Python 3.11+ through shared Resolve-Python.ps1/resolve-python.sh,
  which probe python, python3 and py -3 and skip the Windows Store alias.
  Build and capability checks fail early with an actionable message; doctor
  reports missing Python and the skipped hooks.
- Fix check-capabilities.sh comparing only the major version.
- Register Validate-CommandSafety as a PreToolUse hook for Claude and Codex;
  shared logic in command-safety.py catches rm -rf variants, git reset --hard,
  git clean -f, Remove-Item -Recurse, del/rd /s /q and nested shells.
- Replace duplicated placeholder chains in both builds with
  adapters/placeholders.tsv.
- Restore shell parity: add test-capabilities.sh, rename credentials.ps1 to
  with-credential.ps1 and qmd-warm.sh to start-qmd-warm.sh.
- CI: build once and pass generated/ as an artifact, lint Python with ruff
  and JavaScript modules with node --check, require SHA pins for all actions.
- Add evals for all own skills and update documentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian LechnerandClaude Opus 5.5 committed 2026-11-05 09:34:54 +01:00
1 parent e19aa2e27c
commit 79694fbaa2
95 files changed
+1838 -218

No files matched your search

+8
View File
@@ -13,3 +13,11 @@ Create `shared/skills/<skill>/SKILL.md` for a standalone skill, or `shared/skill
## Add an agent
Create `shared/agents/<agent>/agent.yml` and `instructions.md`. Keep semantic behavior in these shared files; the build renders the Codex and Claude Code formats.
## Add a hook or shell-specific script
Add the script for both shells under `shared/hooks/scripts/` (PowerShell `Verb-Noun.ps1`, Bash `verb-noun.sh`), register it in `adapters/claude/config/settings.json` and `adapters/codex/config/config.toml` with a placeholder such as `__MY_HOOK_SCRIPT__`, and add one row with the PowerShell and Bash values to `adapters/placeholders.tsv`. Both builds read that table, so neither build script needs a change; the build fails on any placeholder left unresolved. Put hook logic that needs more than a few lines into one Python file that both wrappers call, and resolve the interpreter through `Resolve-Python.ps1`/`resolve-python.sh`. If the installer should recognize the hook as setup-owned when merging with local settings, add its name to `OWNED_HOOK_PATTERN` in `scripts/lib/install-options.py`.
## Add evals to a skill
Give every skill an `evals/evals.json` with a few realistic prompts, the expected behavior, and concrete assertions taken from the skill's own instructions. Include at least one negative or near-miss case, such as a prompt where a naive answer would skip a mandated step. Follow the format of the existing files (`skill_name`, and `evals` entries with `id`, `prompt`, `expected_output`, `assertions`, `files`).