detect-convention

Detect the active Git repository convention and default branch as JSON.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/shellicar/skills --skill detect-convention
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detect-convention
Source: https://github.com/shellicar/skills/tree/main/skills/detect-convention
Command: npx skills add https://github.com/shellicar/skills --skill detect-convention

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, sed, grep, and includes scripts (resource) components.

What problem does it solve?

Detects which organizational convention and default branch apply to the current Git repository by examining the git remote URL and the working directory path, enabling consistent branch, commit, and PR rules to be applied.

Core Features & Use Cases

  • Match remote URL patterns and directory path patterns to return a convention identifier such as shellicar-config, shellicar-oss, shellicar, eagers, hopeventures, or flightrac.
  • Resolve the repository default branch via origin/HEAD and provide a protected-branches listing (or none) to guide automation.
  • Use Case: At the start of work on a repository, automatically determine and load convention-specific rules so commits and pull requests follow organizational standards.

Quick Start

Run the detect-convention script in the repository to receive the convention name, default branch, and protected branches as JSON.

Frequently Asked Questions about detect-convention

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically detect git repository conventions for branching and pull requests?

To detect git repository conventions, run a script that examines the remote URL and working directory path to match organizational patterns. It returns the convention name, default branch, and protected branches as JSON for downstream automation.

Can I resolve the default branch and protected branches from a local git repository?

Yes, you can resolve the default branch and protected branches from a local git repository. The tool queries origin/HEAD to determine the default branch and outputs a JSON listing of protected branches to guide your commit and PR workflows.

How do I map a git remote URL to organizational branching and PR workflow rules?

You map a git remote URL to organizational rules by running a detection script that matches the remote and directory paths against known patterns. It outputs a convention identifier like shellicar-oss or flightrac to apply consistent standards.

Does this convention detection tool require specific dependencies to work?

Yes, convention detection requires git, sed, and grep installed in your environment. These dependencies are used to examine the local repository's remote URL and working directory path to successfully map and output the applicable conventions.

What is the best way to load convention-specific rules before starting work on a repository?

The best way to load convention-specific rules is to run a detection script at the start of your work. It identifies the active convention from the repository's remote URL and path, returning JSON data to enforce standard commits and pull requests.

What happens if the git remote URL does not match any known organizational convention?

If the git remote URL does not match known organizational conventions, the detection script will not return a recognized convention identifier. You must ensure your repository's remote URL and directory path align with expected patterns for successful mapping.