[object Object]

← back to Cli Printing Press

fix(skills): add cd to publish-repo before gh pr create/edit (#69)

788a696d0f0661fc2aaf5e16fa18b72c41eaf44a · 2026-03-30 01:49:02 -0700 · Trevin Chow

gh pr create infers the head branch from the current directory's git
context. When the skill runs from a worktree of cli-printing-press,
the CWD is a different repo than .publish-repo, causing "you must
first push" errors even after a successful push.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 788a696d0f0661fc2aaf5e16fa18b72c41eaf44a
Author: Trevin Chow <trevin@trevinchow.com>
Date:   Mon Mar 30 01:49:02 2026 -0700

    fix(skills): add cd to publish-repo before gh pr create/edit (#69)
    
    gh pr create infers the head branch from the current directory's git
    context. When the skill runs from a worktree of cli-printing-press,
    the CWD is a different repo than .publish-repo, causing "you must
    first push" errors even after a successful push.
    
    Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---
 skills/printing-press-publish/SKILL.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/skills/printing-press-publish/SKILL.md b/skills/printing-press-publish/SKILL.md
index 76e7049d..49656abf 100644
--- a/skills/printing-press-publish/SKILL.md
+++ b/skills/printing-press-publish/SKILL.md
@@ -422,6 +422,7 @@ $ <cli-name> --help
 **If updating an existing PR** (`EXISTING_PR_NUMBER` is set):
 
 ```bash
+cd "$PUBLISH_REPO_DIR"
 gh pr edit "$EXISTING_PR_NUMBER" \
   --repo mvanhorn/printing-press-library \
   --body "<constructed PR body>"
@@ -432,6 +433,7 @@ Display: "Updated PR #N: <EXISTING_PR_URL>"
 **If creating a new PR:**
 
 ```bash
+cd "$PUBLISH_REPO_DIR"
 gh pr create \
   --repo mvanhorn/printing-press-library \
   --title "feat(<api-name>): add <cli-name>" \

← 154626ed fix(cli): write .printing-press.json manifest during generat  ·  back to Cli Printing Press  ·  feat(cli): add discovery/ manuscript directory for sniff pro 9bad30af →