From fd7d302a1583fd091ae4c19c47f08fa3404013d3 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sun, 15 Mar 2026 13:47:20 -0400 Subject: [PATCH] Strip "Plan:" prefix from PR titles Co-Authored-By: Claude Opus 4.6 (1M context) --- .../fabro-workflows/src/pull_request.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/crates/fabro-workflows/src/pull_request.rs b/lib/crates/fabro-workflows/src/pull_request.rs index a8f0edf31..1cfa742b5 100644 --- a/lib/crates/fabro-workflows/src/pull_request.rs +++ b/lib/crates/fabro-workflows/src/pull_request.rs @@ -37,6 +37,10 @@ fn pr_title_from_goal(goal: &str) -> String { .strip_prefix("## ") .or_else(|| first_line.strip_prefix("# ")) .unwrap_or(first_line); + let first_line = first_line + .strip_prefix("Plan:") + .map(|s| s.trim()) + .unwrap_or(first_line); if first_line.chars().count() > 120 { let truncated: String = first_line.chars().take(119).collect(); format!("{truncated}…") @@ -816,6 +820,22 @@ mod tests { ); } + #[test] + fn pr_title_strips_plan_prefix() { + assert_eq!( + pr_title_from_goal("Plan: Add Draft PR Mode"), + "Add Draft PR Mode" + ); + } + + #[test] + fn pr_title_strips_heading_and_plan_prefix() { + assert_eq!( + pr_title_from_goal("## Plan: Add Draft PR Mode"), + "Add Draft PR Mode" + ); + } + #[test] fn pr_title_does_not_strip_h3_prefix() { assert_eq!(