Skip to content

pr-to-video: fetch-pr.mjs fails outside a git repo, and owner/repo#N is parsed as a branch name #6027

Closed as not planned

Description

@buhui0611-dotcom

What happened

skills/pr-to-video/scripts/fetch-pr.mjs fails in two ways when the project directory it is told to work in is not a git repository — which is exactly the state the workflow leaves it in: Step 0 runs hyperframes init into a fresh cache dir (e.g. ~/.cache/hyperframes/pr-to-video/<owner>/<repo>/<repo>-pr-<n>), and Step 1 then runs fetch-pr.mjs with that directory as cwd.

1. No repo context → gh subcommand dies

$ cd <fresh hyperframes project dir>            # not a git repo
$ node <SKILL_DIR>/scripts/fetch-pr.mjs --pr "owner/repo#4584" --out-dir ./capture
failed to run git: fatal: not a git repository (or any of the parent directories): .git
✗ fetch-pr.mjs: gh pr view "owner/repo#4584" failed (auth / not found / private?)

2. After adding repo context, the documented owner/repo#N ref is parsed as a branch name

$ git init -q && git remote add origin https://github.com/<owner>/<repo>.git
$ node <SKILL_DIR>/scripts/fetch-pr.mjs --pr "owner/repo#4584" --out-dir ./capture
no pull requests found for branch "owner/repo#4584"
✗ fetch-pr.mjs: gh pr view "owner/repo#4584" failed

Only a bare number works once the project dir has an origin pointing at the PR's repo:

$ node <SKILL_DIR>/scripts/fetch-pr.mjs --pr "4584" --out-dir ./capture
✓ fetch-pr: <owner>/<repo> PR #4584 — "…"

Why

gh pr view <ref> resolves both the repository and the argument against the local git context. The documented --pr forms (<url | owner/repo#N | N>) are only partially handled: the owner/repo#N string is forwarded verbatim as ghost's PR selector, so when a repo context does exist gh interprets it as a branch (<owner>/<repo>#<n> is not a valid PR selector for gh pr view).

Expected

--pr "owner/repo#4584" should work from any directory, including a non-git HyperFrames project dir.

Suggested fix

Parse the ref and pass the two halves separately, always pinning the repo explicitly (no reliance on cwd):

// owner/repo#N  →  gh pr view N --repo owner/repo
// full URL      →  same, parsed
// bare N        →  gh pr view N  (requires a repo context, or a --repo flag)
const args = ["pr", "view", String(number), "--repo", `${owner}/${repo}`, "--json", FIELDS];

gh pr view N --repo OWNER/REPO works outside any git repository, and the follow-up gh api repos/<owner>/<repo>/pulls/N/files is already repo-qualified, so pinning the repo fixes both failure modes. Alternatively, tell the user in the skill docs that the project dir must have an origin and that --pr takes a bare number — but that silently breaks the documented owner/repo#N form.

Repro environment

  • hyperframes CLI 0.8.183, pr-to-video skill from main (2026-10-21)
  • macOS 15 (Intel), gh 2.x authenticated
  • PR used: DataLinkDC/dinky#4584 (public). Same behaviour on any public PR.

Activity

  1. added
    triage/ready
    on Oct 23, 2026
  2. jrusso1020 commented on Oct 24, 2026

    @jrusso1020
    Collaborator

    Closing because the skill this targets was retired in #5651, which cut the published skills from 21 to 7, so the files it refers to are no longer on main. If the same problem shows up in one of the current skills, please open a new issue against that skill. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions