diff --git a/internal/workflow/loader_test.go b/internal/workflow/loader_test.go index d3788fd..c101f90 100644 --- a/internal/workflow/loader_test.go +++ b/internal/workflow/loader_test.go @@ -3,6 +3,7 @@ package workflow //nolint:testpackage // needs access to unexported userHomeDir import ( "os" "path/filepath" + "strings" "testing" ) @@ -247,6 +248,24 @@ func TestReadPrompt_embeddedFallback(t *testing.T) { //nolint:paralleltest // mu } } +func TestReadPrompt_embeddedImplementPromptMentionsGitHubClosingReference(t *testing.T) { //nolint:paralleltest // mutates package-level userHomeDir + tmp := t.TempDir() + userHomeDir = func() (string, error) { return tmp, nil } + t.Cleanup(func() { userHomeDir = os.UserHomeDir }) + + data, err := ReadPrompt(tmp, "prompts/implement.md") + if err != nil { + t.Fatalf("expected embedded fallback, got error: %v", err) + } + content := string(data) + if !strings.Contains(content, "Closes #") { + t.Fatalf("expected implement prompt to mention GitHub closing reference, got %q", content) + } + if !strings.Contains(content, "Do not use cross-repository issue references") { + t.Fatalf("expected implement prompt to restrict cross-repository references, got %q", content) + } +} + func TestReadPrompt_notFound(t *testing.T) { //nolint:paralleltest // mutates package-level userHomeDir tmp := t.TempDir() userHomeDir = func() (string, error) { return tmp, nil } diff --git a/internal/workflow/prompts/implement.md b/internal/workflow/prompts/implement.md index 8696039..1615043 100644 --- a/internal/workflow/prompts/implement.md +++ b/internal/workflow/prompts/implement.md @@ -5,6 +5,8 @@ Read `.auto-pr/run-context.md`. Read the ticket details from the latest `fetch-ticket-data` artifact path listed in the `Latest State Artifacts` section of `.auto-pr/run-context.md`. Read the approved proposal from the latest `investigation` artifact path listed in the `Latest State Artifacts` section of `.auto-pr/run-context.md`. +If the fetched ticket has a GitHub issue `URL:` for this repository, include `Closes #` in the pull request body when you create the PR. Do not use cross-repository issue references for this workflow. + If the `Feedback File` listed in `.auto-pr/run-context.md` exists, incorporate that feedback into your implementation. If a `Guidelines File` is listed in `.auto-pr/run-context.md`, read and follow those guidelines.