General-purpose coding policy for Baruch's AI agents
74
93%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
#!/usr/bin/env bash
# Print the registry baseline a release is measured against, or fail loudly.
#
# Wraps registry-version.sh so the release flow has one command rather
# than a capture, an extraction and an emptiness check for a caller to retype
# (rules/script-delegation.md "Scripts Are Real Files"). Each of those steps
# fails in its own way and all three must stop the release: an unparseable
# baseline, an absent `jq`, or a payload without `.version` each leave the
# caller with an empty PRE, and an empty baseline passes the publish contract's
# second conjunct VACUOUSLY — reporting a publish that never happened
# (rules/ci-safety.md "Always Watch CI").
#
# Usage: registry-baseline.sh <workspace> <plugin>
# Exit 0: the version, or the literal unpublished for a verified absent plugin,
# on stdout. An empty or unreadable response never produces that sentinel.
# Exit 2: a usage error, or a baseline this cannot vouch for; diagnostic on
# stderr. There is no exit 1: the script has no verdict to return, only
# a value or the inability to produce one.
set -euo pipefail
# Command substitution strips every trailing newline, so the script directory
# never passes through one bare: parameter expansion derives it (#487), and a
# sentinel carries `pwd` across the strip (#466).
case "${BASH_SOURCE[0]}" in
*/*) _here_src="${BASH_SOURCE[0]%/*}" ;;
*) _here_src=. ;;
esac
if ! here="$(CDPATH='' cd -- "${_here_src:-/}" && pwd && printf x)"; then
echo "registry-baseline: cannot enter the script directory ${_here_src:-/} — restore read and search access to the plugin directory, or reinstall the plugin, then re-run" >&2
exit 2
fi
here="${here%x}"
here="${here%$'\n'}"
main() {
if [ "$#" -ne 2 ]; then
echo "usage: registry-baseline.sh <workspace> <plugin>" >&2
return 2
fi
local workspace="$1" plugin="$2" payload version
if ! command -v jq >/dev/null 2>&1; then
echo "registry-baseline: jq is not installed; install it before capturing a baseline" >&2
return 2
fi
if ! payload="$(bash "${here}/registry-version.sh" "$workspace" "$plugin")"; then
echo "registry-baseline: could not read the registry baseline for ${workspace}/${plugin} — see the diagnostic above" >&2
return 2
fi
if ! version="$(printf '%s' "$payload" | jq -er 'if type == "object" and has("version") and .version == null then "unpublished" else .version | select(type == "string" and test("^[0-9]+\\.[0-9]+\\.[0-9]+$")) end')"; then
echo "registry-baseline: payload carries no .version with a numeric version or explicit null: ${payload}. Run 'bash ${here}/registry-version.sh ${workspace} ${plugin}' and restore that output contract before retrying" >&2
return 2
fi
if [ -z "$version" ]; then
echo "registry-baseline: empty baseline payload — run 'bash ${here}/registry-version.sh ${workspace} ${plugin}' and restore a numeric version or explicit null before retrying" >&2
return 2
fi
printf '%s\n' "$version"
}
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
main "$@"
fi.tessl-plugin
rules
skills
migrate-to-plugin
onboard-repo
release
hooks
references