PR Markdown Body Discipline
Use this skill when creating or editing pull requests.
Rules (Must)
- Never pass multi-line PR text via a quoted CLI string with
\n. - Always use a markdown file with
--body-file. - Prefer
f pr open editwhen available for local file-driven PR editing.
Why
Inline escaped newlines are fragile and can produce literal \n text in GitHub PR descriptions.
--body-file is deterministic and reviewable.
Safe patterns
Create PR (GitHub CLI)
cat > /tmp/pr-body.md <<'EOF'
## Summary
- ...
## Scope
- ...
EOF
gh pr create --title "..." --body-file /tmp/pr-body.md
Edit existing PR
cat > /tmp/pr-body.md <<'EOF'
## Summary
- ...
EOF
gh pr edit <number> --body-file /tmp/pr-body.md
Flow-native edit loop
f pr open edit
This opens a local markdown file and syncs title/body on save.
Verification
- Run:
gh pr view <number> --json body -q .body
- Confirm markdown renders correctly and contains no literal
\n.