[object Object]

← back to Cli Printing Press

fix(skills): align publish with library-backed skill mirror (#683)

964203239d54f342d108df9218908d6bef574ee5 · 2026-05-07 10:56:01 -0700 · Trevin Chow

* Fix publish skill for new CLI registry deadlock

* Align publish skill with library-tree mirror generation

Files touched

Diff

commit 964203239d54f342d108df9218908d6bef574ee5
Author: Trevin Chow <trevin@trevinchow.com>
Date:   Thu May 7 10:56:01 2026 -0700

    fix(skills): align publish with library-backed skill mirror (#683)
    
    * Fix publish skill for new CLI registry deadlock
    
    * Align publish skill with library-tree mirror generation
---
 internal/pipeline/contracts_test.go    | 18 ++++++++++++++++++
 skills/printing-press-publish/SKILL.md | 11 +++++++----
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/internal/pipeline/contracts_test.go b/internal/pipeline/contracts_test.go
index 33222f9d..57250ba1 100644
--- a/internal/pipeline/contracts_test.go
+++ b/internal/pipeline/contracts_test.go
@@ -137,6 +137,24 @@ func TestPublishSkillTracksCanonicalUpstreamAndOverwriteFlow(t *testing.T) {
 	assert.Contains(t, skill, "git push --force-with-lease")
 }
 
+func TestPublishSkillUsesLibraryTreeForCliSkillsMirror(t *testing.T) {
+	skill := readContractFile(t, filepath.Join("..", "..", "skills", "printing-press-publish", "SKILL.md"))
+
+	assert.Contains(t, skill, "Do not\nedit `registry.json`")
+	assert.Contains(t, skill, "fix the\nlibrary mirror generator to discover from `library/`")
+	assert.Contains(t, skill, "# Regenerate the flat cli-skills mirror from the library tree")
+	assert.Contains(t, skill, "git add library/ cli-skills/")
+	assert.NotContains(t, skill, "git add library/ cli-skills/ registry.json")
+	assert.NotContains(t, skill, "REGISTRY_HAS_ENTRY")
+	assert.NotContains(t, skill, "seed one registry")
+
+	copyIntoLibrary := strings.Index(skill, `cp -r "$STAGING_DIR/library/<category>/<cli-name>"`)
+	mirrorRun := strings.Index(skill, "go run ./tools/generate-skills/main.go")
+	require.NotEqual(t, -1, copyIntoLibrary)
+	require.NotEqual(t, -1, mirrorRun)
+	assert.Less(t, copyIntoLibrary, mirrorRun)
+}
+
 func TestREADMEOutputContract(t *testing.T) {
 	readme := readContractFile(t, filepath.Join("..", "..", "README.md"))
 
diff --git a/skills/printing-press-publish/SKILL.md b/skills/printing-press-publish/SKILL.md
index 0d8c128e..25aea36d 100644
--- a/skills/printing-press-publish/SKILL.md
+++ b/skills/printing-press-publish/SKILL.md
@@ -26,9 +26,12 @@ Publish a generated CLI from your local library to the [printing-press-library](
 The public library treats `library/<category>/<api-slug>/.printing-press.json`
 and `manifest.json` as the source of truth for registry-display fields. Do not
 edit `registry.json` or README catalog cells in publish PRs; the library's
-post-merge workflow regenerates them. Do regenerate and commit the
-`cli-skills/pp-<api-slug>/SKILL.md` mirror because PR CI verifies it against
-`library/<category>/<api-slug>/SKILL.md`.
+post-merge workflow refreshes them from the CLI tree. Do regenerate and commit
+the `cli-skills/pp-<api-slug>/SKILL.md` mirror from
+`library/<category>/<api-slug>/SKILL.md` because PR CI verifies mirror parity.
+If a brand-new CLI's mirror is pruned because `registry.json` is behind, fix the
+library mirror generator to discover from `library/`; do not add a registry
+entry solely to satisfy mirror parity.
 
 ## Setup
 
@@ -390,7 +393,7 @@ cp -r "$STAGING_DIR/library/<category>/<cli-name>" "$PUBLISH_REPO_DIR/library/<c
 # Remove binaries (should not be committed)
 rm -f "$PUBLISH_REPO_DIR/library/<category>/<api-slug>/<api-slug>" "$PUBLISH_REPO_DIR/library/<category>/<api-slug>/<cli-name>"
 
-# Regenerate the flat cli-skills mirror so library PR CI passes mirror parity.
+# Regenerate the flat cli-skills mirror from the library tree so library PR CI passes mirror parity.
 if [ -f "$PUBLISH_REPO_DIR/tools/generate-skills/main.go" ]; then
   (cd "$PUBLISH_REPO_DIR" && go run ./tools/generate-skills/main.go)
 fi

← 823412df chore(ci): clean up release workflow warnings (#679)  ·  back to Cli Printing Press  ·  chore(main): release 4.0.2 (#684) da078d0e →