preguito-skill
2
总安装量
2
周安装量
#66860
全站排名
安装命令
npx skills add https://github.com/jacodoisdois/preguito-skill --skill preguito-skill
Agent 安装分布
opencode
2
claude-code
2
github-copilot
2
codex
2
kimi-cli
2
gemini-cli
2
Skill 文档
Preguito Skill
preguito (CLI name: guito) is a lazy Git CLI with commit templates and shortcode expansion. When working in a preguito project, always prefer guito commands over raw git equivalents.
Detecting a Preguito Project
A project uses preguito if any of these files exist:
.preguitorc(project root).preguitorc.json(project root)~/.config/preguito/config.json(global user config)
Before crafting a commit, read the config to discover the template and shortcodes:
cat .preguitorc 2>/dev/null || cat .preguitorc.json 2>/dev/null
Config Schema
{
"template": "{{type}}: <message>",
"features": {
"cardId": false,
"type": true,
"environment": false
},
"types": [
{ "key": "f", "label": "feat" },
{ "key": "x", "label": "fix" },
{ "key": "c", "label": "chore" },
{ "key": "t", "label": "test" },
{ "key": "r", "label": "refactor" },
{ "key": "o", "label": "docs" }
],
"environments": [],
"defaults": {}
}
Key fields:
templateâ Mustache-style;{{var}}variables +<message>placeholderfeatures.cardIdâ If true, first positional arg toguito cis the card/ticket IDfeatures.typeâ If true, shortcodes arg must include exactly one type letterfeatures.environmentâ If true, shortcodes arg may include one environment letterdefaultsâ Merged into template context automatically (e.g.{ "prefix": "PROJ" })
Template Rendering Rules
Variables use {{varname}} syntax. The <message> placeholder is replaced by the commit message. Optional variables that resolve to empty string trigger cleanup:
()â removed entirely[]â removed entirely{}â removed entirely- Multiple spaces â single space
- Space before colon â removed:
feat : msgâfeat: msg
Common generated templates (from generateTemplate()):
| Features enabled | Template |
|---|---|
| type only | {{type}}: <message> |
| cardId + type | [{{card_id}}] {{type}}: <message> |
| cardId + prefix + type | [{{prefix}}-{{card_id}}] {{type}}: <message> |
| type + environment | {{type}}({{environment}}): <message> |
| cardId + type + environment | [{{card_id}}] {{type}}({{environment}}): <message> |
| environment only | ({{environment}}): <message> |
Command Syntax: guito c
guito c [card_id] [shortcodes] <message...> [flags]
Positional argument order is strict and depends on enabled features:
card_idâ first arg, only iffeatures.cardIdis true (any string:"42","PROJ-42")shortcodesâ concatenated single string, only iffeatures.typeorfeatures.environmentis truemessageâ everything remaining, joined with spaces (no quotes required for multiple words)
Flags
| Flag | Long | Description |
|---|---|---|
-p |
--push |
Push after committing |
-f |
--force |
Push with --force-with-lease after committing |
-d |
--dry-run |
Print generated message without executing |
-S |
--no-stage |
Skip auto-staging (git add -A). By default, all changes are staged automatically |
Shortcode Resolution
Each character in the shortcodes string is independently resolved:
- Matches a
typeskey â setstypein context - Matches an
environmentskey â setsenvironmentin context - Exactly one type shortcode required if
features.typeis true - At most one environment shortcode; environment is always optional
- Character matching both type and env â ambiguity error
- Character matching neither â unknown shortcode error
Default Type Shortcodes
| Key | Label | When to use |
|---|---|---|
f |
feat | New feature or capability |
x |
fix | Bug fix |
c |
chore | Maintenance, deps, config |
t |
test | Adding or modifying tests |
r |
refactor | Code restructuring, no behavior change |
o |
docs | Documentation |
l |
lint | Linting fixes |
y |
style | Code style / formatting |
e |
perf | Performance improvement |
b |
build | Build system / scripts |
Default Environment Shortcodes
| Key | Label |
|---|---|
p |
prd |
u |
uat |
h |
homolog |
d |
dev |
s |
staging |
Complete Examples by Feature Combination
Config: type only (default config)
guito c f "add user authentication"
# â feat: add user authentication
guito c x "fix null pointer in login" -p
# â fix: fix null pointer in login (then pushes)
guito c r "extract service layer" -d
# dry-run â prints: refactor: extract service layer
Config: cardId + type
guito c 42 f "add user authentication"
# â [42] feat: add user authentication
guito c PROJ-123 r "extract service layer"
# â [PROJ-123] refactor: extract service layer
guito c 99 c "update dependencies" -p
# â [99] chore: update dependencies (then pushes)
Config: cardId + type + environment
guito c 42 fp "deploy payment gateway"
# â [42] feat(prd): deploy payment gateway
guito c 77 xd "fix timeout bug" -p
# â [77] fix(dev): fix timeout bug (then pushes)
guito c 10 fu "release to uat"
# â [10] feat(uat): release to uat
Config: type + environment (no cardId)
guito c fp "deploy login service"
# â feat(prd): deploy login service
guito c xs "fix staging crash"
# â fix(staging): fix staging crash
Config: cardId + prefix in defaults
{ "defaults": { "prefix": "TASK" }, "template": "[{{prefix}}-{{card_id}}] {{type}}: <message>" }
guito c 55 f "add export endpoint"
# â [TASK-55] feat: add export endpoint
All Other Commands
# Push
guito p # git push
guito pu # git push --set-upstream origin <branch>
# Rebase
guito r <branch> # checkout branch â pull â rebase current onto it
guito ri <count> # interactive rebase for last N commits
guito re <hash> # edit rebase at specific commit hash
# Amend
guito ap # amend last commit + force push
guito apl # amend last commit + force-with-lease push
# Undo
guito u [count] # soft reset last N commits, keep changes staged (default 1)
# Fixup
guito cf <hash> # create fixup commit targeting hash [-p] [-f]
# Branch
guito sw <branch> # switch to existing branch
guito sw -n <branch> # create and switch to new branch
# Stash
guito st [-m "msg"] # stash changes
guito stp # stash pop
guito stl # stash list
# Status / Diff
guito s # git status --short
guito d # diff [-s staged] [--stat] [-n name-only]
# Log / Search
guito l [count] # compact oneline log (default 10)
guito f <keyword> # search commits by message [-n number]
guito t <tag> # commits since tag [-a all reachable]
# Config / Init
guito cfg # show current config [--path] [--template]
guito i # interactive setup wizard
guito i --default # write default config without prompts
How to Help Users Craft Commits
- Check if
.preguitorcor.preguitorc.jsonexists - Parse
templateandfeaturesfrom the config - Determine what positional args are needed (
cardIdâshortcodesâmessage) - Map the user’s description to the appropriate type shortcode
- Build the
guito cinvocation - Always show dry-run first:
guito c ... -d - Execute when the user confirms
Common Mistakes to Avoid
- NEVER use
git commit -m "..."in preguito projects â always useguito c - NEVER use
git pushâ useguito p - NEVER invent shortcodes â read from the config’s
typesarray - NEVER separate shortcodes with spaces â
f pis wrong,fpis correct - NEVER chain multiple types â
fxmeans feat+fix which is invalid; one type only - Shortcodes arg is one concatenated string:
fpnotf p - Auto-staging is ON by default â no need to
git addbeforeguito cunless using-S