diff --git a/askcc/definitions.py b/askcc/definitions.py index ff52f50..5550499 100644 --- a/askcc/definitions.py +++ b/askcc/definitions.py @@ -281,7 +281,19 @@ On completion: - Run /simplify or /refactor to simplify and improve the code. - Commit, push the feature branch, and open a PR linked to the issue. +- Update the test plan checklist in the PR description (see "Test plan update" below). - Add an issue comment summarizing what was implemented. + +Test plan update: +- After opening the PR, read the PR description with `gh pr view --json body -q .body`. +- Look for a `## Test plan` section containing checklist items (`- [ ]` checkboxes). +- For each test plan task, decide whether it is satisfied by the implementation, \ +the new tests you wrote, or the verification gate run (pytest/ruff/pyright). +- Check off satisfied tasks by replacing `- [ ]` with `- [x]` in the PR body. +- Leave items requiring manual/external verification (browser QA, deployment \ +validation, etc.) unchecked. +- Update the PR description with `gh pr edit --body ""`. +- If no `## Test plan` section exists, skip this step silently. """ REVIEW_AGENT_PROMPT = ( diff --git a/tests/test_askcc.py b/tests/test_askcc.py index 2d6e2e5..10a9bea 100644 --- a/tests/test_askcc.py +++ b/tests/test_askcc.py @@ -279,6 +279,34 @@ def test_removes_legacy_write_tests_line(self): assert "Write tests for every new or changed behavior" not in DEVELOP_AGENT_PROMPT +class TestDevelopPromptTestPlanUpdate: + """The develop prompt must update the PR test plan after PR creation (issue #88). + + Assertions are literal-substring matches: prompt-wording changes will surface + here intentionally. Don't "fix" them away — update both the prompt and the + asserted substrings together, mirroring the TestReviewprPromptMergeGuard precedent. + """ + + def test_includes_test_plan_update_section_heading(self): + assert "Test plan update:" in DEVELOP_AGENT_PROMPT + + def test_includes_pr_body_read_command(self): + assert "gh pr view --json body -q .body" in DEVELOP_AGENT_PROMPT + + def test_includes_pr_body_edit_command(self): + assert 'gh pr edit --body ""' in DEVELOP_AGENT_PROMPT + + def test_includes_manual_verification_carveout(self): + assert "manual/external verification" in DEVELOP_AGENT_PROMPT + assert "unchecked" in DEVELOP_AGENT_PROMPT + + def test_includes_noop_when_no_test_plan_section(self): + assert "If no `## Test plan` section exists, skip this step" in DEVELOP_AGENT_PROMPT + + def test_completion_step_references_test_plan_update(self): + assert "Update the test plan checklist in the PR description" in DEVELOP_AGENT_PROMPT + + class TestReviewprPromptMergeGuard: """The pr-review prompt must block merging when CHANGES_REQUESTED reviews exist (issue #86)."""