forge-detect
Skill1 starsChanged 54 days agoMITView on GitHub
Detect the forge type from the current repo's git remote. Sets $FORGE_CLI, $FORGE_TYPE, and $FORGE_HOST. Provides per-forge command templates for PR and issue operations.
In this repository28 other files it gives its agents.
- journal-coachSkill
- github-templatesSkill
- node-ciSkill
- renovateSkill
- create-readmeSkill
- markdown-styleSkill
- mermaid-syntaxSkill
- obsidian-vaultSkill
- ste100Skill
- forgejo-issueSkill
- forgejo-prSkill
- web-frontendSkill
- docker-pythonSkill
- pyproject-tomlSkill
- python-ciSkill
- python-cliSkill
- python-devcontainerSkill
- python-projectSkill
- architecture-briefSkill
- design-advisorSkill
- saas-anti-pattern-reviewSkill
- saas-transition-chain-reviewSkill
- saas-transition-reviewSkill
- saas-transition-strategySkill
- security-reviewerSkill
- technical-debt-reviewSkill
- commit-messageSkill
- discord-sendSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Run git remote get-url origin and parse the host:
- Very specific: line 36
If $FORGE_TYPE == "forgejo", load forgejo-pr and forgejo-issue now.
- Very specific: line 40
If $FORGE_TYPE == "github" or "gitlab", no extra skills needed.
- Very specific: line 45
All operations below use $ID for the PR/issue number and <path> for file arguments.
- Very specific: line 89
If the repo requires a template, add --template <key> or --no-template (run fj issue templates --remote origin first to list templates).
- Very specific: line 94
Before creating an issue, read the repo's templates and use their conventions.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Forge Detect
Load this skill at the start of any workflow that needs to interact with pull requests or issues on GitHub, Forgejo, or GitLab.
Setup
- The repo must have a remote named
origin - The forge CLI must be installed and authenticated
(
ghfor GitHub,fjfor Forgejo,glabfor GitLab)
Detection
Run git remote get-url origin and parse the host:
| Remote host | $FORGE_TYPE | $FORGE_CLI |
github.com | github | gh |
codeberg.org | forgejo | fj |
gitlab.com or *.gitlab.* | gitlab | glab |
| Other | unsupported — abort | — |
Also set $FORGE_HOST to the detected hostname.
Load forge-specific skills
If $FORGE_TYPE == "forgejo", load forgejo-pr and forgejo-issue
now. They are the authoritative reference for all fj subcommands,
flags, and patterns.
If $FORGE_TYPE == "github" or "gitlab", no extra skills needed.
Refer to gh or glab CLI documentation for detailed usage.
Command templates
All operations below use $ID for the PR/issue number and <path>
for file arguments.
PR view (title, body, metadata)
$FORGE_TYPE | Command |
github | gh pr view $ID --json title,body,changedFiles,headRefName,baseRefName,additions,deletions |
forgejo | fj pr view $ID |
gitlab | glab mr view $ID |
PR diff
$FORGE_TYPE | Command |
github | gh pr diff $ID |
forgejo | fj pr view $ID diff |
gitlab | glab mr diff $ID |
PR files
$FORGE_TYPE | Command |
github | gh pr view $ID --json files --jq '.files[].path' |
forgejo | fj pr view $ID files |
gitlab | glab mr view $ID --json files --jq '.files[].path' |
PR comment
$FORGE_TYPE | Command |
github | gh pr comment $ID --body-file <path> |
forgejo | fj pr comment $ID --body-file <path> |
gitlab | glab mr note $ID --message "$(cat <path>)" |
Issue create
$FORGE_TYPE | Command |
github | gh issue create --title "<title>" --body-file <path> |
forgejo | fj issue create --remote origin "<title>" --body-file <path> |
gitlab | glab issue create --title "<title>" --description "$(cat <path>)" |
For Forgejo, the title is a positional argument (not a --title flag).
If the repo requires a template, add --template <key> or --no-template
(run fj issue templates --remote origin first to list templates).
Issue template conventions
Before creating an issue, read the repo's templates and use their
conventions. For each template, parse the YAML front-matter (title:
prefix, labels:, about:/name:) and the ## body headings. Pick
the template whose description best matches the issue type, use its
title: prefix and labels, and fill its ## sections. For types
without a matching template, reuse the nearest one and override the
prefix/label.
Issue edit labels
$FORGE_TYPE | Command |
github | gh issue edit $ID --add-label <label> |
forgejo | fj issue edit $ID labels --add <label> --remote origin |
gitlab | Not supported — skip label management by glab |
Issue search by labels
$FORGE_TYPE | Command |
github | gh issue list --state open --label <label> --json number,title |
forgejo | fj issue search --remote origin --labels <label> --state open |
gitlab | glab issue list --state opened --label <label> |
Issue close
$FORGE_TYPE | Command |
github | gh issue close $ID |
forgejo | fj issue close $ID --remote origin |
gitlab | glab issue close $ID |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

