sandcastle-merge/SKILL.md
Merges a specified branch into the current branch using pnpm-based verification (typecheck + tests), resolves conflicts, and optionally closes a GitHub issue via gh CLI. Use when the user mentions "Sandcastle", asks to merge a branch and close an issue, or references the Sandcastle merge protocol.
npx skillsauth add anahelenasilva/skills sandcastle-mergeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
With explicit branch:
bash scripts/merge.sh sandcastle/impl/2026-05-17T15-20-45
bash scripts/close-issue.sh 123 # skip if no issue
With auto-detection (picks most recent worktree):
bash scripts/merge.sh
bash scripts/close-issue.sh 123
Then output <promise>COMPLETE</promise> exactly.
The branch to merge lives in a worktree under one of:
.sandcastle/worktrees/.claude/worktrees/Its name follows the pattern:
sandcastle/impl/${new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19)}
Example: sandcastle/impl/2026-05-17T15-20-45
Check both directories to find the active worktree before merging.
git merge {{BRANCH}} --no-editpnpm run typecheck and pnpm run test to verify everything worksYou can use scripts/merge.sh to automate steps 1, 3, and 4 (conflict resolution still requires manual reasoning).
After the merge succeeds, close the issue. If {{ISSUE_ID}} is empty, skip this step and do not attempt to close anything.
gh issue close {{ISSUE_ID}} --comment "Completed by Sandcastle and merged to main."
Once you've merged (and closed the issue if applicable), output exactly:
<promise>COMPLETE</promise>
<promise>COMPLETE</promise> is part of the Sandcastle protocol and must be preserved verbatim.{{ISSUE_ID}} is empty or missing.sandcastle/impl/* branches exist, confirm with the user which one to merge.tools
Autonomously implements open GitHub issues labeled "Sandcastle" one at a time using the RALPH workflow (explore, plan, RGR test-first, verify, commit, close). Use when the user says "implement next Sandcastle issue", "process open issues", "run RALPH", or asks to work through the Sandcastle backlog. Assumes pnpm, gh CLI, and git are configured in the current repo.
development
Reviews and refines code on a branch for the Sandcastle project. Use when asked to "review", "clean up", "refine", or "code review" on a branch. Call as `/sandcastle-code-review` to review the current branch, or `/sandcastle-code-review [branch-name]` to review a specific branch. Makes improvements in place — reads the diff, fixes issues, runs tests, commits. Do NOT use for general code questions or reviews outside the Sandcastle project.
development
Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.
tools
Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.