Skip to content
Skills Library
Programming · Automation

set-session-context

/set-session-context

Use when starting a session on a non-main branch, switching branches (git checkout, git switch), or when a hook prompts for session context update. Also invocable manually via /set-session-context.

Repository
skill-issue ↗
Licence
MIT
Last repository change
16.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 16.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when starting a session on a non-main branch, switching branches (git checkout, git switch), or when a hook prompts for session context update. Also invocable manually via /set-session-context.

Original author description

Use when starting a session on a non-main branch, switching branches (git checkout, git switch), or when a hook prompts for session context update. Also invocable manually via /set-session-context.

How it works

  1. Steps
  2. Behavior
Original SKILL.md headings · 51 lines, 219 words
SKILL.md preview
---
name: set-session-context
description: >-
  Use when starting a session on a non-main branch, switching branches
  (git checkout, git switch), or when a hook prompts for session context
  update. Also invocable manually via /set-session-context.
---

# Set Session Context

Automatically set session name and color based on the current git branch and PR.

## Steps

1. **Detect branch:**
   ```bash
   git symbolic-ref --short HEAD
   ```
   - If detached HEAD (command fails) → stop, do nothing
   - If `main` or `master` → stop, do nothing

2. **Look up PR title:**
   ```bash
   gh pr view --json title --jq '.title'
   ```

3. **Determine session name:**
   - If PR exists → use PR title
   - If no PR → humanize branch name: strip the conventional prefix and slash/hyphen separator, replace remaining hyphens with spaces
     - `feat/add-widget` → `add widget`
     - `fix-login-bug` → `login bug`

4. **Run:** `/rename <session name>`

5. **Determine color** from the branch prefix (match `^(type)[/-]`):

   | Prefix | Color |
   |---|---|
   | `feat` | blue |
   | `fix` | red |
   | `chore` | green |
   | `docs` | cyan |
   | `refactor` | yellow |
   | `test` | purple |
   | `ci` | orange |
   | `build` | orange |
   | `perf` | yellow |
   | `style` | cyan |
   | _(no match)_ | blue |

6. **Run:** `/color <color>`

## Behavior

- Execute silently: do not announce, explain, or narrate what you are doing.
- Do not ask for confirmation.
- If `gh` is unavailable or fails, fall back to the humanized branch name.

Versions

The database has no other skills named set-session-context.

Database snapshot: 13.11.2026 · package version 4487a69d4921 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100git-branch-conventions
    Use when running git checkout -b, git switch -c, git worktree add -b, or any command that creates a new work branch — enforces semantic prefix naming.
  • 100checkout-branch
    Create and validate Git branch names following this codebase's Conventional Commits naming convention. Use this skill when creating branches, renaming branches, or when asked about branch naming rules and validation.
  • 100catchup
    Summarizes recent git changes for context recovery after session breaks. Use when resuming work after a gap or handing off to another session.
  • 100git-branch-pr-workflow
    Branch management and PR workflows — git switch/restore, GitHub MCP. Use when creating branches, opening PRs, or working with feature branches.
  • 90git-branch
    Git branch naming guidelines, including the label to branch-type table. Use when creating or checking out new branches, including branches for stacked pull requests, and when the user asks to rename a branch.
  • 100create-branch
    Create a git branch following Sentry naming conventions. Use when asked to "create a branch", "new branch", "start a branch", "make a branch", "switch to a new branch", or when starting new work on the default branch.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.