$npx -y skills add mvanhorn/cli-printing-press --skill printing-press-scoreScore a generated CLI against the Steinberger bar, compare two CLIs side-by-side
| 1 | # /printing-press-score |
| 2 | |
| 3 | Score generated CLIs against the Steinberger bar. Supports rescoring, scoring by name/path, and comparing two CLIs. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | ``` |
| 8 | /printing-press-score # rescore current CLI |
| 9 | /printing-press-score notion-pp-cli-4 # score by name |
| 10 | /printing-press-score ~/my-cli # score by path |
| 11 | /printing-press-score notion-pp-cli-4 vs notion-pp-cli-2 # compare two |
| 12 | ``` |
| 13 | |
| 14 | ## Prerequisites |
| 15 | |
| 16 | - Go 1.26.5 or newer installed |
| 17 | - `cli-printing-press` binary on PATH (install with `go install github.com/mvanhorn/cli-printing-press/v4/cmd/cli-printing-press@latest`) |
| 18 | |
| 19 | ## Step 0: Setup |
| 20 | |
| 21 | Before any other commands, run the setup contract to verify the cli-printing-press binary is on PATH and initialize scope variables: |
| 22 | |
| 23 | <!-- PRESS_SETUP_CONTRACT_START --> |
| 24 | ```bash |
| 25 | # min-binary-version: 4.0.0 |
| 26 | |
| 27 | # Derive scope first — needed for local build detection |
| 28 | _scope_dir="$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")" |
| 29 | _scope_dir="$(cd "$_scope_dir" && pwd -P)" |
| 30 | |
| 31 | # Prefer local build when running from inside the printing-press repo. |
| 32 | _press_repo=false |
| 33 | if [ -x "$_scope_dir/cli-printing-press" ] && [ -d "$_scope_dir/cmd/cli-printing-press" ]; then |
| 34 | _press_repo=true |
| 35 | export PATH="$_scope_dir:$PATH" |
| 36 | echo "Using local build: $_scope_dir/cli-printing-press" |
| 37 | elif ! command -v cli-printing-press >/dev/null 2>&1; then |
| 38 | if [ -x "$HOME/go/bin/cli-printing-press" ]; then |
| 39 | echo "cli-printing-press found at ~/go/bin/cli-printing-press but not on PATH." |
| 40 | echo "Add GOPATH/bin to your PATH: export PATH=\"\$HOME/go/bin:\$PATH\"" |
| 41 | else |
| 42 | echo "cli-printing-press binary not found." |
| 43 | echo "Install with: go install github.com/mvanhorn/cli-printing-press/v4/cmd/cli-printing-press@latest" |
| 44 | fi |
| 45 | return 1 2>/dev/null || exit 1 |
| 46 | fi |
| 47 | |
| 48 | # Resolve and emit the absolute path the agent must use for every later |
| 49 | # `cli-printing-press` invocation. `export PATH` above only affects this one |
| 50 | # Bash tool call; subsequent calls open a fresh shell and resolve bare |
| 51 | # `cli-printing-press` against the user's default PATH, where a stale global |
| 52 | # can silently shadow the local build. The agent captures this marker and |
| 53 | # substitutes the absolute path into every later invocation. |
| 54 | if [ "$_press_repo" = "true" ]; then |
| 55 | PRINTING_PRESS_BIN="$_scope_dir/cli-printing-press" |
| 56 | else |
| 57 | PRINTING_PRESS_BIN="$(command -v cli-printing-press 2>/dev/null || true)" |
| 58 | fi |
| 59 | echo "PRINTING_PRESS_BIN=$PRINTING_PRESS_BIN" |
| 60 | |
| 61 | PRESS_BASE="$(basename "$_scope_dir" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9_-]/-/g; s/^-+//; s/-+$//')" |
| 62 | if [ -z "$PRESS_BASE" ]; then |
| 63 | PRESS_BASE="workspace" |
| 64 | fi |
| 65 | |
| 66 | PRESS_SCOPE="$PRESS_BASE-$(printf '%s' "$_scope_dir" | shasum -a 256 | cut -c1-8)" |
| 67 | PRESS_HOME="${PRINTING_PRESS_HOME:-$HOME/printing-press}" |
| 68 | PRESS_RUNSTATE="$PRESS_HOME/.runstate/$PRESS_SCOPE" |
| 69 | PRESS_LIBRARY="$PRESS_HOME/library" |
| 70 | PRESS_MANUSCRIPTS="$PRESS_HOME/manuscripts" |
| 71 | PRESS_CURRENT="$PRESS_RUNSTATE/current" |
| 72 | |
| 73 | mkdir -p "$PRESS_RUNSTATE" "$PRESS_LIBRARY" "$PRESS_MANUSCRIPTS" "$PRESS_CURRENT" |
| 74 | ``` |
| 75 | <!-- PRESS_SETUP_CONTRACT_END --> |
| 76 | |
| 77 | After running the setup contract, capture the `PRINTING_PRESS_BIN=<abs-path>` line from stdout. **Every subsequent `cli-printing-press ...` invocation in this skill must use that absolute path** (substitute the value, not the literal `$PRINTING_PRESS_BIN` token) — `export PATH` above only affects the single Bash tool call it runs in, so later calls open a fresh shell where bare `cli-printing-press` resolves against the user's default `PATH` and a stale global can shadow the local build. |
| 78 | |
| 79 | After capturing the binary path, check binary version compatibility. Read the `min-binary-version` field from this skill's YAML frontmatter. Run `<PRINTING_PRESS_BIN> version --json` and parse the version from the output. Compare it to `min-binary-version` using semver rules. If the installed binary is older than the minimum, stop immediately and tell the user: "cli-printing-press binary vX.Y.Z is older than the minimum required vA.B.C. Run `go install github.com/mvanhorn/cli-printing-press/v4/cmd/cli-printing-press@latest` to update." |
| 80 | |
| 81 | Current-run state is resolved from `$PRESS_RUNSTATE`. Published CLIs are resolved from `$PRESS_LIBRARY`. Archived manuscripts are resolved from `$PRESS_MANUSCRIPTS`. |
| 82 | |
| 83 | ## Step 1: Parse Arguments |
| 84 | |
| 85 | Read the user's input after `/printing-press-score`. The input is **free-form** — interpret intent, don't enforce syntax. |
| 86 | |
| 87 | **Noise words to strip:** `compare`, `vs`, `versus`, `and`, `against`, `with`, `to` |
| 88 | |
| 89 | After stripping noise words, count the remaining tokens: |
| 90 | |
| 91 | - **0 tokens** → Rescore Current mode |
| 92 | - **1 token** → Score Single mode |
| 93 | - **2 tokens** → Compare mode |
| 94 | |
| 95 | ## Step 2: Resolve CLI Directories |
| 96 | |
| 97 | For each CLI identifier, resolve |