Straight to main
Reusable agent skills for real repository work: review, implementation, release, documentation, and project hygiene.
npx -y skills add bakerstreetco/skills --skill straight-to-mainAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Publish a small, self-contained change directly to a repository's GitHub-defined default branch from a clean worktree. Use when a checkout has drifted onto another branch or contains unrelated local changes, but the requested change should be committed and pushed straight to the default branch after verifying direnv, Git identity, remote identity, and cleanup.
SKILL.md
4.2 KB, 819 tokens by cl100k_base, as published. Nobody here has run it
Straight to Main
Use this skill when the requested change is small enough to publish directly to the repository default branch, but the current checkout is dirty, on the wrong branch, or carrying drift from previous work.
Do not assume the default branch is named main. Determine it from the remote hosting provider, preferably with GitHub CLI for GitHub repositories.
Required Preflight
Before any command that changes history, reads or writes remotes, or depends on a hosting account:
- Identify the active repository root with
git rev-parse --show-toplevel. - Read the repository instructions, especially any
AGENTS.mdguidance for direnv, generated files, staging, and remote identity. - Check for an applicable
.envrcin the repository root or parent path. - If
.envrcexists anddirenvis available, load it in the shell used for GitHub and git remote operations. - If direnv is blocked, stale, or not allowed, stop before remote or history-changing actions and ask the user how to proceed.
- Verify identity before acting:
git config user.namegit config user.emailgit remote -vgh auth statusor the relevant hosting CLI account
- Continue only when the identity and remote match the intended repository account.
Never print secrets, tokens, private keys, or credential-helper output.
Default Branch Discovery
For GitHub repositories, use the active repository identity to ask GitHub for the default branch:
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name
If the repository has a required direnv context for GitHub commands, run the query inside that context. For example:
direnv exec /path/to/repo gh repo view --json defaultBranchRef --jq .defaultBranchRef.name
If the hosting CLI cannot verify the default branch, stop before committing or pushing unless there is another authoritative repository source for the default branch.
Clean Worktree Path
Use a separate clean worktree when the current checkout has unrelated edits, is on a drifted branch, or has generated output that would mix with the requested change.
- Confirm the current checkout's dirty state so unrelated edits are known and preserved.
- Create a temporary worktree from the verified default branch.
- Pull or fetch/rebase the temporary worktree so it is current with the remote default branch.
- Apply only the requested small change in the temporary worktree.
- Run the repository's required validation or build commands.
- Inspect the diff and ensure only the requested source files and required generated follow-up files changed.
- Stage explicit paths only; never use
git add .orgit commit -a. - Commit with the repository's existing message style.
- Run
git pull --rebase --autostash, thengit push. - Check
git status --short --branch.
When the temporary worktree lacks ignored local files such as .envrc, run hosting and push-sensitive commands through the original repository's direnv context, for example:
direnv exec /path/to/original/repo git -C /path/to/temp-worktree push
Cleanup
After a successful push:
- Remove only this session's duplicated change from the original dirty checkout, if it was first applied there.
- Leave unrelated existing edits and untracked files untouched.
- Remove the temporary worktree.
- Re-check the original checkout status and confirm it no longer contains the just-published change.
Do not reset, checkout, or delete unrelated local work unless the user explicitly asks for that cleanup.
Reporting
In the final response, include:
- The commit hash and message.
- The verified default branch name and how it was discovered.
- The files included in the commit.
- The validation/build command that passed.
- Whether the original drifted checkout was cleaned back to unrelated local changes only.
What ships with it: 2 files
744 B alongside SKILL.md
agents/
- openai.yaml219 B
- skill.json525 B