$npx -y skills add mvanhorn/cli-printing-press --skill printing-press-reprintRegenerate an existing printed CLI from scratch under the current Printing Press, with prior research, prior novel features, and prior patches (post-publish hand-fixes) carried into the writing pipeline as reconciliation context rather than dropped on the floor. Pulls the CLI fro
| 1 | # /printing-press-reprint |
| 2 | |
| 3 | Regenerate an existing printed CLI under the current machine. The user gives |
| 4 | a CLI name and (optionally) reasons for the reprint. This skill ensures the |
| 5 | prior CLI is locally present, recommends whether to reuse or redo prior |
| 6 | research, and hands off to `/printing-press` with the context the |
| 7 | novel-features subagent needs to reconcile prior features against the |
| 8 | current machine — keep, reframe, or drop with reasons, never silent. |
| 9 | |
| 10 | ```bash |
| 11 | /printing-press-reprint notion |
| 12 | /printing-press-reprint cal.com the new MCP intent surface landed and the prior CLI ships endpoint-mirror only |
| 13 | /printing-press-reprint allrecipes |
| 14 | ``` |
| 15 | |
| 16 | ## When to run |
| 17 | |
| 18 | - A significant Printing Press upgrade (new MCP surface, new auth modes, new |
| 19 | transport, scoring rubric changes) would lift this CLI more than manual |
| 20 | polish. |
| 21 | - The published CLI ships with a known systemic gap a reprint would fix. |
| 22 | - The user wants prior novel features re-evaluated against the current |
| 23 | machine and current personas, not carried forward verbatim. |
| 24 | |
| 25 | For one-off code-quality fixes, prefer `/printing-press-polish` — it doesn't |
| 26 | redo research or rebuild the manuscript. |
| 27 | |
| 28 | ## Setup |
| 29 | |
| 30 | ```bash |
| 31 | PRESS_HOME="${PRINTING_PRESS_HOME:-$HOME/printing-press}" |
| 32 | PRESS_LIBRARY="$PRESS_HOME/library" |
| 33 | PRESS_MANUSCRIPTS="$PRESS_HOME/manuscripts" |
| 34 | |
| 35 | # Mid-pipeline callers may pass printing_press_bin: <abs-path> in the args |
| 36 | # bundle. Prefer it so reprint keeps using the parent skill's preflight-selected |
| 37 | # binary instead of re-resolving through PATH. |
| 38 | PRINTING_PRESS_BIN="${PRINTING_PRESS_BIN:-}" |
| 39 | if [ -z "$PRINTING_PRESS_BIN" ] && [ -n "${ARGUMENTS:-}" ]; then |
| 40 | PRINTING_PRESS_BIN="$(printf '%s\n' "$ARGUMENTS" | sed -nE 's/^[[:space:]]*printing_press_bin:[[:space:]]*(.+)$/\1/p' | head -1)" |
| 41 | fi |
| 42 | if [ -z "$PRINTING_PRESS_BIN" ]; then |
| 43 | PRINTING_PRESS_BIN="$(command -v cli-printing-press 2>/dev/null || true)" |
| 44 | fi |
| 45 | |
| 46 | if [ -z "$PRINTING_PRESS_BIN" ]; then |
| 47 | echo "cli-printing-press binary not found." |
| 48 | echo "Install with: go install github.com/mvanhorn/cli-printing-press/v4/cmd/cli-printing-press@latest" |
| 49 | return 1 2>/dev/null || exit 1 |
| 50 | fi |
| 51 | echo "PRINTING_PRESS_BIN=$PRINTING_PRESS_BIN" |
| 52 | ``` |
| 53 | |
| 54 | ## Phase A — Resolve and reconcile presence |
| 55 | |
| 56 | Resolve the user's argument the same way `/printing-press-import` does: |
| 57 | fetch the public library `registry.json` once, then exact → normalized → |
| 58 | fuzzy match. The argument can be an API slug (`notion`), a brand name |
| 59 | (`cal.com`), an old `<api>-pp-cli` form, or close enough. |
| 60 | |
| 61 | Capture from the matched registry entry: `API_SLUG` (from `.name`) and |
| 62 | `LIB_PATH` (from `.path`, e.g., `library/productivity/cal-com`). Phase B |
| 63 | uses `$LIB_PATH` for the public patches fetch. For the "present | absent" |
| 64 | never-published row, `$LIB_PATH` stays empty — Phase B's fetch |
| 65 | short-circuits on that. |
| 66 | |
| 67 | Then check what exists locally and reconcile against the public library by |
| 68 | reading both provenance manifests' `run_id` and `generated_at`: |
| 69 | |
| 70 | | Local | Public registry | Action | |
| 71 | |-------|-----------------|--------| |
| 72 | | absent | absent | STOP — nothing to reprint; suggest `/printing-press <api>` for a fresh print | |
| 73 | | absent | present | invoke `/printing-press-import <api>`, then continue | |
| 74 | | present | absent | continue — never-published local CLI; skip import | |
| 75 | | present, same `run_id` | present | continue without import | |
| 76 | | present, public newer `generated_at` | present | offer import via `AskUserQuestion`; user decides | |
| 77 | | present, local newer `generated_at` | present | STOP — local has unpublished work; tell user to publish or discard first | |
| 78 | |
| 79 | When invoking `/printing-press-import`, let it own backup, overwrite, |
| 80 | build-verify, and module-path-rewrite. Wait for it to return clean before |
| 81 | continuing. |
| 82 | |
| 83 | ## Phase B — Verify reconcilable prior context |
| 84 | |
| 85 | Locate the two artifacts the writing pipeline should be aware of: research |
| 86 | (drives novel-features Pass 2(d)) and patches (post-publish hand-fixes |
| 87 | recorded by `/printing-press-amend`, e.g. live-discovered API quirks the |
| 88 | spec didn't reveal). |
| 89 | |
| 90 | ```bash |
| 91 | LIB_TARGET="$PRESS_LIBRARY/$API_SLUG" |
| 92 | LIB_RESEARCH="$LIB_TARGET/research.json" |
| 93 | MAN_RESEARCH=$(ls -1t "$PRESS_MANUSCRIPTS/$API_SLUG"/*/research.json 2>/dev/null | head -1) |
| 94 | ``` |
| 95 | |
| 96 | ### Research absent |
| 97 | |
| 98 | I |