home / skills / richtabor / agent-skills / ralph-github-create-issues

ralph-github-create-issues skill

/skills/ralph-github-create-issues

This skill converts local PRD or plan markdowns into GitHub issues to automate the PRD to issues workflow with parent and sub-issues.

npx playbooks add skill richtabor/agent-skills --skill ralph-github-create-issues

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
3.6 KB
---
name: ralph-github-create-issues
description: Converts a PRD markdown file into GitHub Issues (parent + sub-issues) for ralph-github-start-loop to execute. Use when user wants to push PRD stories to GitHub Issues.
---

# Create PRD Issues

Convert a local PRD or plan file into GitHub Issues.

## Usage

```
/ralph-create-github-issues              # Looks in .claude/plans/ then prds/
/ralph-create-github-issues auth-flow    # Convert specific PRD by name
```

For story sizing and acceptance criteria guidance, see `references/best-practices.md`.

## Preflight

Run these checks. Stop if critical ones fail.

```bash
# 1. Auth check
gh auth status

# 2. Find plan/PRD files — check all locations
ls .claude/plans/*.md 2>/dev/null
ls plans/*.md 2>/dev/null
ls prds/*.md 2>/dev/null

# 3. PRD not already an issue (stop if found open)
gh issue list --label prd --state all --json number,title,state

# 4. Ensure prd label exists
gh label create prd --description "Product Requirements Document" --color "0052CC" 2>/dev/null || true

# 5. Get existing PRDs for dependency matching
gh issue list --label prd --state open --json number,title
```

### Where to find plans

Check these locations in order:

1. **`.claude/plans/`** — Where plan mode saves approved plans. This is the primary source.
2. **`plans/`** — Project-level plans directory.
3. **`prds/`** — Standalone PRDs not generated from plan mode.

If files exist in multiple locations, list all and ask which to convert. If only one file is found, use it directly. **If no files are found in any location, ask the user for the path to their PRD/plan file.**

Scan PRD markdown for dependency references ("depends on X", "see `feature.md`"). Note matches for later.

**Note:** Assume `gh sub-issue` and `gh issue-dependency` are already installed. Do NOT try to install them. Just run the commands — if they fail, skip that step and continue.

## Create Issues

### Parent Issue

```bash
gh issue create \
  --title "Feature Name" \
  --label "prd" \
  --label "enhancement" \
  --body "$(cat <<'EOF'
## Overview
<From PRD intro>

## Branch
`feature/<name>`

## Quality Gates
```bash
npm run typecheck
npm run lint
npm test
```

## Implementation Order
1. Story one
2. Story two
EOF
)"
```

### Sub-Issues

For each story:

```bash
# Create issue
gh issue create \
  --title "Story Title" \
  --body "$(cat <<'EOF'
**Files:** `path/to/file.tsx`

**Acceptance Criteria:**
- [ ] Specific change
- [ ] Typecheck passes
- [ ] Lint passes

**Notes:**
Context if needed.
EOF
)"

# Link to parent
gh sub-issue add <parent> <child>
```

### Dependencies

If dependencies detected in preflight, use GraphQL API (no extension needed):

```bash
# Get repo info
OWNER=$(gh repo view --json owner -q '.owner.login')
REPO=$(gh repo view --json name -q '.name')

# Get node IDs (replace 50 and 42 with actual issue numbers)
BLOCKED_ID=$(gh api graphql -f query="{ repository(owner: \"$OWNER\", name: \"$REPO\") { issue(number: 50) { id } } }" --jq '.data.repository.issue.id')
BLOCKING_ID=$(gh api graphql -f query="{ repository(owner: \"$OWNER\", name: \"$REPO\") { issue(number: 42) { id } } }" --jq '.data.repository.issue.id')

# Add blocked-by relationship
gh api graphql -f query="mutation { addBlockedBy(input: {issueId: \"$BLOCKED_ID\", blockingIssueId: \"$BLOCKING_ID\"}) { clientMutationId } }"
```

## Output

```
Created: #50 - Feature Name
  → #51 Story One
  → #52 Story Two

Dependencies: Blocked by #42 (Auth Flow)
Branch: feature/<name>

Run: /ralph-github-start-loop
```

Then ask:

```
Remove local plan/PRD file? <path> (y/n)
```

If yes, delete the source file. GitHub Issue is now source of truth.

Overview

This skill converts a local PRD or plan Markdown file into a structured set of GitHub Issues: a parent issue labeled as the PRD and child issues for each story. It automates issue creation, parent/child linking, and optional cross-issue dependency wiring so the PRD becomes the source of truth in GitHub. Use it to push planned stories into an issue-based workflow quickly.

How this skill works

The skill scans common plan locations (.claude/plans/, plans/, prds/) for a PRD file, parses the Markdown to extract the feature overview, branch name, story titles, and acceptance criteria, then runs gh commands to create a parent issue and sub-issues. It links sub-issues to the parent with gh sub-issue and, when dependencies are detected, uses the GitHub GraphQL API to add blocked-by relationships. It performs preflight checks for auth, existing PRD issues, and label presence before creating issues.

When to use it

  • You have a local PRD/plan Markdown and want to push it into GitHub Issues.
  • You need a parent issue with discrete story issues and acceptance criteria preserved.
  • You want dependencies represented as GitHub issue relationships.
  • You plan to delete the local PRD and make GitHub the source of truth.
  • You are preparing work for an automated start loop or CI-driven workflow.

Best practices

  • Keep PRD files in .claude/plans/, plans/, or prds/ so the skill can find them automatically.
  • Include clear story titles, acceptance criteria, and file paths in the PRD for concise issue bodies.
  • Label the parent issue with prd and a relevant type (e.g., enhancement) to ease discovery.
  • Run the preflight checks and fix critical failures (auth, duplicate PRD issues) before converting.
  • Confirm dependency references are explicit (e.g., “depends on #42” or “see auth-flow”) to enable linking.

Example use cases

  • Convert an approved product requirements Markdown into a GitHub parent issue plus child stories for the dev team.
  • Migrate standalone PRDs from a repo folder into issue-based tracking and delete the local file.
  • Create issues with acceptance criteria and file references for precise implementation tasks.
  • Add blocked-by relationships when a story depends on another open PRD in the repo.
  • Bulk-import multiple plan files by running the command for each PRD found in the standard locations.

FAQ

What if no PRD file is found in the standard locations?

The skill will prompt you to provide the PRD path. Provide a valid Markdown path and it will proceed.

Do I need extensions like gh sub-issue installed?

The skill assumes gh sub-issue and gh issue-dependency are available; it will run commands and skip steps that fail without attempting installation.