# Pull Request Content Generation

## Generate PR Title

```bash
BRANCH_NAME=$(echo $CURRENT | sed 's/.*\///')
BRANCH_TYPE=$(echo $CURRENT | cut -d'/' -f1)

case "$BRANCH_TYPE" in
  feature) TITLE="feat: $BRANCH_NAME" ;;
  hotfix)  TITLE="fix: $BRANCH_NAME" ;;
  release) TITLE="release: v$GF_VERSION" ;;
esac
```

## Generate PR Body

```markdown
## Summary

{Auto-generated from commit messages}

## Changes

{List of files changed with categories}

## Testing

- [ ] Build passes
- [ ] Unit tests pass
- [ ] Manual testing completed

## EF Core Migrations

{Migration status: None | Added | Modified}

---

🤖 Generated with [Claude Code](https://claude.ai/code)
```

## Persist PR Info for Merge Step

```bash
# Persist PR info for merge step (uses config path for portability)
CONFIG_DIR=$(dirname "$GF_CONFIG_FILE")
cat > "$CONFIG_DIR/cache/pr-state.json" << EOF
{
  "pr_number": "$PR_NUMBER",
  "pr_url": "$PR_URL",
  "source_branch": "$CURRENT",
  "target_branch": "$TARGET_BRANCH",
  "git_provider": "$GIT_PROVIDER",
  "created_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
}
EOF
echo "✓ PR state saved to $CONFIG_DIR/cache/pr-state.json"
```
