diff --git a/CHANGELOG.md b/CHANGELOG.md index 4593d3f1..b3ab5818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 0.6.1.0 — 2026-03-17 + +### Added + +- **`/ship` now uses your repo's PR template.** If your repo has a `.github/PULL_REQUEST_TEMPLATE.md` (or any standard location), `/ship` reads it and uses it as the base structure for the PR body — filling in your sections, preserving your checkboxes, and appending ship-specific sections (eval results, review findings, etc.) only where the template doesn't already cover them. No template? Falls back to the existing default format. +- **New `{{REPO_TEMPLATE_DETECT}}` placeholder for skill authors.** Drop it into any `.tmpl` file and get automatic detection of PR templates, issue templates, and bug report templates. Any skill that creates PRs or issues can reuse this resolver. + +### Changed + +- Removed hardcoded "Generated with Claude Code" signature from PR bodies — that's up to each repo's own PR template to decide. + ## 0.6.0.1 — 2026-03-17 - **`/gstack-upgrade` now catches stale vendored copies automatically.** If your global gstack is up to date but the vendored copy in your project is behind, `/gstack-upgrade` detects the mismatch and syncs it. No more manually asking "did we vendor it?" — it just tells you and offers to update. diff --git a/VERSION b/VERSION index 758efdb4..44e7f9a2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0.1 +0.6.1.0 diff --git a/scripts/gen-skill-docs.ts b/scripts/gen-skill-docs.ts index 31684e21..4ea6b6ce 100644 --- a/scripts/gen-skill-docs.ts +++ b/scripts/gen-skill-docs.ts @@ -1009,6 +1009,50 @@ Only commit if there are changes. Stage all bootstrap files (config, test direct ---`; } +function generateRepoTemplateDetect(): string { + return `## Repo Template Detection + +Before creating a PR, issue, or bug report via \`gh\`, check if the target repo provides GitHub templates: + +\`\`\`bash +# PR templates (check all common locations) +for f in .github/PULL_REQUEST_TEMPLATE.md .github/pull_request_template.md .github/PULL_REQUEST_TEMPLATE/default.md docs/pull_request_template.md PULL_REQUEST_TEMPLATE.md; do + [ -f "$f" ] && echo "PR_TEMPLATE: $f" && break +done + +# Issue templates +if [ -d ".github/ISSUE_TEMPLATE" ]; then + echo "ISSUE_TEMPLATES:" + ls .github/ISSUE_TEMPLATE/*.md .github/ISSUE_TEMPLATE/*.yml 2>/dev/null +elif [ -f ".github/ISSUE_TEMPLATE.md" ]; then + echo "ISSUE_TEMPLATE: .github/ISSUE_TEMPLATE.md" +fi +\`\`\` + +**If a PR template is found:** + +1. Read the template file. It defines the repo's expected PR structure — section headings, + checklists, required fields, etc. +2. Use the repo template as the **base structure** for the PR body. Fill in its sections + with the information you have (summary, test results, etc.). +3. **Merge, don't replace.** If the skill needs sections the repo template doesn't have + (e.g., "Eval Results", "Greptile Review"), append them after the repo template's sections. + If the repo template has sections the skill doesn't populate (e.g., "Related Issues", + "Screenshots"), leave them with a sensible default or "N/A" — don't delete them. +4. Preserve any checkboxes, required fields, or HTML comments from the repo template. + These often trigger CI checks or reviewer workflows. + +**If no PR template is found:** Use the skill's default PR body format (defined in the +skill's own instructions). + +**For issues:** If the repo has issue templates (\`.github/ISSUE_TEMPLATE/\`), list the +available templates and pick the best match for the issue type (bug report, feature +request, etc.). Read the chosen template and fill in its fields. If no issue templates +exist, use a sensible default format. + +---`; +} + const RESOLVERS: Record string> = { COMMAND_REFERENCE: generateCommandReference, SNAPSHOT_FLAGS: generateSnapshotFlags, @@ -1019,6 +1063,7 @@ const RESOLVERS: Record string> = { DESIGN_METHODOLOGY: generateDesignMethodology, REVIEW_DASHBOARD: generateReviewDashboard, TEST_BOOTSTRAP: generateTestBootstrap, + REPO_TEMPLATE_DETECT: generateRepoTemplateDetect, }; // ─── Template Processing ──────────────────────────────────── diff --git a/ship/SKILL.md b/ship/SKILL.md index 32582088..0630c47a 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -810,9 +810,65 @@ git push -u origin --- +## Step 7.5: Detect Repo PR Template + +## Repo Template Detection + +Before creating a PR, issue, or bug report via `gh`, check if the target repo provides GitHub templates: + +```bash +# PR templates (check all common locations) +for f in .github/PULL_REQUEST_TEMPLATE.md .github/pull_request_template.md .github/PULL_REQUEST_TEMPLATE/default.md docs/pull_request_template.md PULL_REQUEST_TEMPLATE.md; do + [ -f "$f" ] && echo "PR_TEMPLATE: $f" && break +done + +# Issue templates +if [ -d ".github/ISSUE_TEMPLATE" ]; then + echo "ISSUE_TEMPLATES:" + ls .github/ISSUE_TEMPLATE/*.md .github/ISSUE_TEMPLATE/*.yml 2>/dev/null +elif [ -f ".github/ISSUE_TEMPLATE.md" ]; then + echo "ISSUE_TEMPLATE: .github/ISSUE_TEMPLATE.md" +fi +``` + +**If a PR template is found:** + +1. Read the template file. It defines the repo's expected PR structure — section headings, + checklists, required fields, etc. +2. Use the repo template as the **base structure** for the PR body. Fill in its sections + with the information you have (summary, test results, etc.). +3. **Merge, don't replace.** If the skill needs sections the repo template doesn't have + (e.g., "Eval Results", "Greptile Review"), append them after the repo template's sections. + If the repo template has sections the skill doesn't populate (e.g., "Related Issues", + "Screenshots"), leave them with a sensible default or "N/A" — don't delete them. +4. Preserve any checkboxes, required fields, or HTML comments from the repo template. + These often trigger CI checks or reviewer workflows. + +**If no PR template is found:** Use the skill's default PR body format (defined in the +skill's own instructions). + +**For issues:** If the repo has issue templates (`.github/ISSUE_TEMPLATE/`), list the +available templates and pick the best match for the issue type (bug report, feature +request, etc.). Read the chosen template and fill in its fields. If no issue templates +exist, use a sensible default format. + +--- + ## Step 8: Create PR -Create a pull request using `gh`: +Create a pull request using `gh`. + +**If a repo PR template was found in Step 7.5:** Read it and use its structure as the base +for the PR body. Fill in its sections with the data gathered during the ship workflow. Then +append any ship-specific sections that the repo template doesn't already cover: + +- **Pre-Landing Review** — findings from Step 3.5, or "No issues found." +- **Eval Results** — if evals ran: suite names, pass/fail counts, cost dashboard. If skipped: "No prompt-related files changed — evals skipped." +- **Greptile Review** — if comments found: bullet list with [FIXED] / [FALSE POSITIVE] / [ALREADY FIXED] tag. If no PR existed during Step 3.75: omit entirely. +- **TODOS** — if items marked complete: bullet list with version. If TODOS.md doesn't exist and user skipped: omit. +- **Test plan** — test pass/fail counts + +**If no repo PR template was found:** Use this default format: ```bash gh pr create --base --title ": " --body "$(cat <<'EOF' @@ -843,8 +899,6 @@ gh pr create --base --title ": " --body "$(cat <<'EOF' ## Test plan - [x] All Rails tests pass (N runs, 0 failures) - [x] All Vitest tests pass (N tests) - -🤖 Generated with [Claude Code](https://claude.com/claude-code) EOF )" ``` diff --git a/ship/SKILL.md.tmpl b/ship/SKILL.md.tmpl index e059fc6a..b6a26f33 100644 --- a/ship/SKILL.md.tmpl +++ b/ship/SKILL.md.tmpl @@ -541,9 +541,25 @@ git push -u origin --- +## Step 7.5: Detect Repo PR Template + +{{REPO_TEMPLATE_DETECT}} + ## Step 8: Create PR -Create a pull request using `gh`: +Create a pull request using `gh`. + +**If a repo PR template was found in Step 7.5:** Read it and use its structure as the base +for the PR body. Fill in its sections with the data gathered during the ship workflow. Then +append any ship-specific sections that the repo template doesn't already cover: + +- **Pre-Landing Review** — findings from Step 3.5, or "No issues found." +- **Eval Results** — if evals ran: suite names, pass/fail counts, cost dashboard. If skipped: "No prompt-related files changed — evals skipped." +- **Greptile Review** — if comments found: bullet list with [FIXED] / [FALSE POSITIVE] / [ALREADY FIXED] tag. If no PR existed during Step 3.75: omit entirely. +- **TODOS** — if items marked complete: bullet list with version. If TODOS.md doesn't exist and user skipped: omit. +- **Test plan** — test pass/fail counts + +**If no repo PR template was found:** Use this default format: ```bash gh pr create --base --title ": " --body "$(cat <<'EOF' @@ -574,8 +590,6 @@ gh pr create --base --title ": " --body "$(cat <<'EOF' ## Test plan - [x] All Rails tests pass (N runs, 0 failures) - [x] All Vitest tests pass (N tests) - -🤖 Generated with [Claude Code](https://claude.com/claude-code) EOF )" ```