Repository navigation
Description
Problem
scaffold-description.sh (91 lines) writes a starting PR_AGENTDESC.md from the repository's pull request template. It chooses the base, protects an existing draft, and refuses a template outside the repository. Both preflight.sh (when the draft is absent) and the test suites call it on its own, so it needs its own tested behavior before the preflight and the wrappers can move.
Part of #588 and #323. Delivers in Go the behavior of packages/agents/source/skills/pr/shared/scripts/scaffold-description.sh. This change adds Go behavior only and switches no caller. Property resolution (properties.sh, 47 lines) is not a scaffold concern and has no entry point of its own: at origin/main the only caller is create-pr.sh, which sources it, and no test or skill runs it alone. It is therefore delivered with publication in child 08.
Acceptance criteria
- AC1: Given no draft and a template, when the scaffold runs, then
PR_AGENTDESC.mdholds frontmatter withbase,draft: false,labels: [],reviewers: [],assignees: []and an emptymilestone, then a blank line, the title placeholder# <type>(<scope>)?: <description>, a blank line and the template verbatim, and the run prints which file was scaffolded from which template and the guidance lines the shell prints. - AC2: Given a nonempty draft exists and no
--force, when the scaffold runs, then it prints that the draft already exists and was left alone, exits 0 and leaves the file byte-identical. - AC3: Given an existing draft that is empty, when the scaffold runs without
--force, then it populates the draft; given a nonempty draft and--force, then it replaces the draft. - AC4: Given a base argument, when the scaffold runs, then
baseis that argument; given none andorigin/HEADset, then it is the branchorigin/HEADnames; given neither, thenmain. - AC5: Given
pr_templatenames a path outside the repository, when the scaffold runs, then it refuses with the shell's message; given the named template does not exist, then it exits 1 with "no template at " and writes nothing. - AC6: Non-functional: the scaffold writes only
PR_AGENTDESC.mdand makes no network connection.
Scope and non-goals
Scope: the scaffold behavior above.
Non-goal: resolving labels, milestones or issue references against GitHub, which child 08 does with publication. Non-goal: label creation or any GitHub write. Non-goal: switching the shell caller to the Go behavior, which child 12 does.
Approach
Meet AC1 to AC6 with failing table-driven cases first on scratch repositories, comparing the written draft byte for byte with the shell's. The package layout is the implementer's choice within those outcomes.
Dependencies
Blocked by: #910.
Prerequisite: the repository configuration reader delivered under #321.
Size
S. One pull request.
Verify plan
- AC1, AC4: Go tests over a scratch repository compare the written draft and printed lines with the shell's.
- AC2, AC3: Go tests for a nonempty draft, an empty draft, and a nonempty draft with
--force, checking bytes and exit status. - AC5: Go tests with a template outside the repository and a missing template, checking message and exit status.
- AC6: a test asserts the set of files written and that no network connection is attempted.
- Go tests run in the existing Go CI on macOS, Linux and Windows.
- Definition of done: D1 each AC is verified at the merged head, with the commands and results cited in the pull request's Verification. D2 an independent review approves the exact merged head, and every finding has a recorded disposition. D3 required checks pass with no gate loosened. D4 the leak scans the repository specifies are clean, and every post made for this work passes the per-post leak review before it is posted. D5 every commit is signed. D6 the documentation matches the change or the Verification says why there is no impact. D7 every commit has an
Assisted-bytrailer and the pull request has theprovenance:agent-assistedlabel. D8 the pull request stays within the size limits. D9 follow-ups are filed as issues and listed under Related. D10 the merge closes the issue through a closing reference, the board shows Done, and the finalStatus:comment names the merge commit.
Risks
Overwriting a draft under revision loses the author's work. The AC2 and AC3 cases are the control. Undo: revert the change; nothing calls the Go behavior yet and the shell scaffolds as before.
Operator authority
None.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Work type
Projects
- StatusShow more project fieldsBacklog
Activity
tbhb-agent commentedon Oct 27, 2026
Refinement: READY — Scaffold a draft from agentrepo pr
Model: gpt-6-astra
Child 04 Scaffold a draft from agentrepo pr
Verdict: READY
Checked: Existing nonempty drafts, empty drafts and forced replacement have distinct outcomes and checks. The binding properties decision leaves this child scaffold-only; the sole maintained caller sources properties during publication. Evidence:
packages/agents/source/skills/pr/shared/scripts/scaffold-description.sh:54,packages/agents/source/skills/pr/shared/scripts/scaffold-description.sh:61,packages/agents/source/skills/pr/shared/scripts/create-pr.sh:182.Gaps: None.
Split: S fits the settled scope.
Definition of done
The definition of done for this issue (Feature). Tick each item and give its evidence.
check-leaks.shwith the repository's private-strings list, and the leak review of each post.docs/, CHANGELOG or help text), or the Verification section says "No doc impact" and why.provenance:agent-assistedlabel.Status:comment names the merge commit.mise run checkis green, and so are the coverage floorsmise run cover-go-checkandmise run cover-py-check, whichcheckdoesn't run.packages/agents/source/commits whatmise run generate-skills, thenmise run skill-tokens, thenapm installrewrite, in that order, andcheck-generated-skills(part oflint) passes.docs/agent-skills-migration.mdor the adoption docs, or the PR's Verification says "No consumer impact" and why.Round: 3 of 3