Skip to content

fix: dynamic base branch detection across all SKILL templates (v0.3.10)#81

Open
garrytan wants to merge 11 commits intomainfrom
garrytan/fix-base-branch-in-ship
Open

fix: dynamic base branch detection across all SKILL templates (v0.3.10)#81
garrytan wants to merge 11 commits intomainfrom
garrytan/fix-base-branch-in-ship

Conversation

@garrytan
Copy link
Owner

Summary

  • {{BASE_BRANCH_DETECT}} resolver — DRY placeholder in gen-skill-docs.ts for dynamic base branch detection (PR base → repo default → fallback to main)
  • Ship, review, QA, plan-ceo-review — all detect base branch dynamically instead of hardcoding main. Fixes stacked branches and Conductor workspaces targeting non-main branches.
  • Retro — detects repo default branch via simpler inline check (handles main vs master)
  • QA bash-isms cleaned up — removed shell variable cross-block state, simplified port detection to natural language
  • gstack-upgrade — explicit cross-step prose for variable references between bash blocks
  • CLAUDE.md "Writing SKILL templates" — authoring guidance (natural language > bash-isms, dynamic branches, self-contained blocks)
  • Regression tests — hardcoded-main scanner in skill-validation.test.ts + resolver content test in gen-skill-docs.test.ts
  • ARCHITECTURE.md and CONTRIBUTING.md updated with new placeholder docs

Pre-Landing Review

No issues found. All changes are markdown templates, documentation, and test additions — no SQL, no security surfaces.

Eval Results

No prompt-related files changed — evals skipped.

Test plan

  • All skill validation tests pass (77 tests, 599 assertions)
  • skill:check — all skills fresh, all valid
  • New hardcoded-main regression test passes across all templates
  • New BASE_BRANCH_DETECT resolver content test passes

🤖 Generated with Claude Code

garrytan and others added 8 commits March 15, 2026 20:04
DRY placeholder for dynamic base branch detection across PR-targeting
skills. Detects via gh pr view (existing PR base) → gh repo view
(repo default) → fallback to main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces ~14 hardcoded 'main' references with dynamic detection via
{{BASE_BRANCH_DETECT}}. Fixes stacked branches and Conductor workspaces
targeting non-main branches. Adds --base <base> to gh pr create.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same pattern as ship: replaces hardcoded 'main' with {{BASE_BRANCH_DETECT}}.
Also cleans up qa bash-isms (REPORT_DIR variable, port chaining).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Retro queries commit history (not PR targets), so uses simpler detection:
gh repo view defaultBranchRef. Replaces ~11 origin/main refs with
origin/<default>.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bash blocks are self-contained, but cross-block variable references
(INSTALL_DIR from Step 2) were implicit. Adds prose making them explicit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds "Writing SKILL templates" section to CLAUDE.md explaining that
templates are prompts, not scripts. Adds validation test catching
hardcoded 'main' in git commands, and resolver content test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add {{BASE_BRANCH_DETECT}} to ARCHITECTURE.md placeholder list.
Cross-reference CLAUDE.md template authoring guidance from CONTRIBUTING.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
garrytan and others added 3 commits March 16, 2026 02:01
Takes main's v0.4.1 version, PREAMBLE/QA_METHODOLOGY/qa-only additions,
contributor mode, and session tracking. Reapplies BASE_BRANCH_DETECT
resolver and dynamic base branch detection across all templates.
Regenerates all 11 SKILL.md files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- /review: verifies Step 0 detection + git diff against detected base
- /ship: truncated dry-run (Steps 0-1 only, no push/PR), asserts no
  destructive actions
- /retro: verifies default branch detection for git log queries

Covers the {{BASE_BRANCH_DETECT}} resolver path (review), the ship
template's dual abort check, and retro's inline detection pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants