Skip to content

Check open PRs for in-progress drafts before scaffolding a new skill/agent - #348

Merged
d-morrison merged 5 commits into
mainfrom
claude/skill-duplication-open-prs-gxl4ql
Jul 2, 2026
Merged

Check open PRs for in-progress drafts before scaffolding a new skill/agent#348
d-morrison merged 5 commits into
mainfrom
claude/skill-duplication-open-prs-gxl4ql

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Summary

  • skill-builder and agent-builder already scan local branches and worktrees for in-flight duplicate work, but that scan misses a branch already pushed and opened as a PR (it's never fetched into local refs).
  • Adds a new shared fragment, shared/workflow/check-open-prs-before-duplicating.md, spelling out an open-PR check (gh pr list / mcp__github__list_pull_requests) and what to do when a match is found: pick up a stalled draft, or redirect the caller to an active one instead of building a competing second draft.
  • Wires the fragment into skill-builder's and agent-builder's step 0 (extend/reuse-before-create), their frontmatter descriptions, and their anti-patterns lists.
  • spot-skill-opportunities's existing-coverage check now also names the open-PR case, pointing to the same fragment, without duplicating the full procedure (it still hands off the actual check to skill-builder/agent-builder).

Test plan

  • Reviewed the new fragment against the existing branch/worktree-scan style in skill-builder step 0 for consistency.
  • Confirmed the gh pr list / MCP fallback mapping (LIST_PRS) already exists in tool-mappings.md.
  • Verified relative markdown-link paths (../../shared/workflow/...) match the convention used elsewhere in skills/*/SKILL.md.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 2 commits July 2, 2026 03:52
…agent

skill-builder and agent-builder already scan local branches/worktrees for
in-flight duplicates, but a branch already pushed and opened as a PR is
invisible to that scan unless it's fetched. Add a shared fragment and wire
it into both skills' step 0, so a caller gets redirected to a stalled or
active PR instead of building a competing draft.
@claude

This comment has been minimized.

@claude

This comment has been minimized.

```

In a remote/web session without `gh`, use the GitHub MCP equivalent
(`mcp__github__list_pull_requests` / `mcp__github__search_pull_requests` —

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mcp__github__search_pull_requests is referenced here but is not registered in tool-mappings.md or tool-mappings.yml — only mcp__github__list_pull_requests is (as LIST_PRS). The "see tool-mappings.md" pointer is accurate for mcp__github__list_pull_requests but misleading for mcp__github__search_pull_requests: a reader who looks there won't find it.

This also violates skill-builder's own standing convention (skills/skill-builder/SKILL.md:136–144):

If the procedure names a GitHub MCP tool … not already in tool-mappings.yml … add it there.

(The same anti-pattern is listed at line 286 of that skill: "Naming a GitHub MCP tool the skill uses without registering it in tool-mappings.yml.")

The tool is real — it already appears in skills/gi/SKILL.md:209, skills/gip/SKILL.md:58, and memories/tools.md:148 — so this isn't a hallucination, just an incomplete registration.

Suggested fix: add an entry to tool-mappings.yml (and the table in tool-mappings.md) for mcp__github__search_pull_requests, e.g.:

- id: SEARCH_PRS
  description: Search pull requests by keyword / query string.
  cli: gh pr list --search "<query>"
  github_mcp: mcp__github__search_pull_requests

Then regenerate the Codex wrappers so the new op appears in the tool-mapping tables of codex-skills/skill-builder/SKILL.md and codex-skills/agent-builder/SKILL.md.

The check-open-prs-before-duplicating fragment named this MCP tool
without registering it, per @claude review on #348.
@claude

This comment has been minimized.

claude added 2 commits July 2, 2026 03:57
main picked up new skills (prompt-me family, fact-check-prose) since
this branch was cut; resync the generated codex-skills/ tree.
@claude

claude Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 1m 36s —— View job


Re-review of PR #348

  • Update comment with in-progress status
  • Read key changed files (tool-mappings, new fragment, wired skills)
  • Verify prior finding is addressed
  • Check for new issues
  • Post verdict

Verdict: clean

The one finding from the prior reviewmcp__github__search_pull_requests unregistered in tool-mappings — is fully resolved by commit 7bacd2b:

  • tool-mappings.yml lines 44–47: SEARCH_PRS entry added.
  • tool-mappings.md line 26: the generated table row appears.
  • codex-skills/skill-builder/SKILL.md and codex-skills/agent-builder/SKILL.md line 31: the SEARCH_PRS row is present in the embedded tool-mapping tables.

No new issues found. The new fragment, its wiring into all three skills, and the full Codex wrapper regeneration are all structurally sound.

@d-morrison
d-morrison merged commit 1e5edd0 into main Jul 2, 2026
5 checks passed
@d-morrison
d-morrison deleted the claude/skill-duplication-open-prs-gxl4ql branch July 2, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants