@seanyao/roll 2026.506.2 → 2026.506.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/bin/roll +2 -86
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Unified behavioral conventions for Claude Code / Gemini CLI / Cursor / Codex —
|
|
|
66
66
|
| `roll setup` | First-time install on this machine, or re-sync after editing `~/.roll/config.yaml` (use `--force` to overwrite local cache) |
|
|
67
67
|
| `roll update` | One-step upgrade: `npm install -g @seanyao/roll@latest` + re-sync via `roll setup` |
|
|
68
68
|
| `roll init` | New project: create `AGENTS.md` + `BACKLOG.md` + `docs/features/` |
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
| `roll status` | Show sync state, skill links, and detected AI tools |
|
|
71
71
|
|
|
72
72
|
### Typical Flow
|
|
@@ -83,8 +83,7 @@ roll init
|
|
|
83
83
|
# 3. Upgrade to a new release
|
|
84
84
|
roll update
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
roll hook install
|
|
86
|
+
|
|
88
87
|
```
|
|
89
88
|
|
|
90
89
|
### How Convention Layering Works
|
package/bin/roll
CHANGED
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
# Roll — AI Agent Convention Manager
|
|
5
5
|
# Single source of truth for how all AI coding agents behave.
|
|
6
6
|
|
|
7
|
-
VERSION="2026.506.
|
|
7
|
+
VERSION="2026.506.3"
|
|
8
8
|
ROLL_HOME="${ROLL_HOME:-${HOME}/.roll}"
|
|
9
9
|
ROLL_CONFIG="${ROLL_HOME}/config.yaml"
|
|
10
10
|
ROLL_GLOBAL="${ROLL_HOME}/conventions/global"
|
|
@@ -531,19 +531,6 @@ cmd_setup() {
|
|
|
531
531
|
echo ""
|
|
532
532
|
ok "Setup complete. 初始化完成。"
|
|
533
533
|
|
|
534
|
-
# Offer git hook install if not already installed (interactive terminals only)
|
|
535
|
-
local hook_dst="$HOME/.config/git/hooks/prepare-commit-msg"
|
|
536
|
-
local hooks_path
|
|
537
|
-
hooks_path=$(git config --global core.hooksPath 2>/dev/null || true)
|
|
538
|
-
if [[ -t 0 ]] && { [[ ! -f "$hook_dst" ]] || [[ "$hooks_path" != "$HOME/.config/git/hooks" ]]; }; then
|
|
539
|
-
echo ""
|
|
540
|
-
echo -n " Install global git hook (tags commits with AI client)? [y/N] "
|
|
541
|
-
read -r _hook_ans
|
|
542
|
-
if [[ "${_hook_ans:-N}" =~ ^[Yy]$ ]]; then
|
|
543
|
-
cmd_hook install
|
|
544
|
-
fi
|
|
545
|
-
fi
|
|
546
|
-
|
|
547
534
|
echo ""
|
|
548
535
|
info "Next: run ${BOLD}roll init${NC} inside a project to initialize it. 下一步:在项目目录运行 roll init"
|
|
549
536
|
}
|
|
@@ -1056,61 +1043,6 @@ detect_project_type() {
|
|
|
1056
1043
|
fi
|
|
1057
1044
|
}
|
|
1058
1045
|
|
|
1059
|
-
|
|
1060
|
-
# ═══════════════════════════════════════════════════════════════════════════════
|
|
1061
|
-
# COMMAND: hooks <subcommand>
|
|
1062
|
-
# Manage the global git hook (opt-in — modifies git global config)
|
|
1063
|
-
# ═══════════════════════════════════════════════════════════════════════════════
|
|
1064
|
-
cmd_hook() {
|
|
1065
|
-
local subcmd="${1:-install}"
|
|
1066
|
-
|
|
1067
|
-
case "$subcmd" in
|
|
1068
|
-
install)
|
|
1069
|
-
local hooks_dir="$HOME/.config/git/hooks"
|
|
1070
|
-
local hook_src="$ROLL_PKG_DIR/hooks/prepare-commit-msg"
|
|
1071
|
-
local hook_dst="$hooks_dir/prepare-commit-msg"
|
|
1072
|
-
|
|
1073
|
-
if [[ ! -f "$hook_src" ]]; then
|
|
1074
|
-
err "Hook source not found: $hook_src Hook 源文件未找到: $hook_src"
|
|
1075
|
-
exit 1
|
|
1076
|
-
fi
|
|
1077
|
-
|
|
1078
|
-
local current_hooks_path
|
|
1079
|
-
current_hooks_path=$(git config --global core.hooksPath 2>/dev/null || echo "(not set)")
|
|
1080
|
-
|
|
1081
|
-
echo ""
|
|
1082
|
-
warn "This will modify your global git configuration: 此操作将修改您的全局 git 配置:"
|
|
1083
|
-
echo " git config --global core.hooksPath $hooks_dir"
|
|
1084
|
-
echo ""
|
|
1085
|
-
echo " Current value: $current_hooks_path 当前值: $current_hooks_path"
|
|
1086
|
-
echo ""
|
|
1087
|
-
if [[ "$current_hooks_path" != "(not set)" ]] && [[ "$current_hooks_path" != "$hooks_dir" ]]; then
|
|
1088
|
-
warn "WARNING: Hooks at '$current_hooks_path' will stop running after this change. 警告:此更改后 '$current_hooks_path' 处的 hooks 将不再运行。"
|
|
1089
|
-
echo ""
|
|
1090
|
-
fi
|
|
1091
|
-
echo -n " Proceed? [y/N] "
|
|
1092
|
-
read -r answer
|
|
1093
|
-
[[ "$answer" =~ ^[Yy]$ ]] || { info "Aborted. 已取消。"; return; }
|
|
1094
|
-
|
|
1095
|
-
mkdir -p "$hooks_dir"
|
|
1096
|
-
cp "$hook_src" "$hook_dst"
|
|
1097
|
-
chmod +x "$hook_dst"
|
|
1098
|
-
git config --global core.hooksPath "$hooks_dir"
|
|
1099
|
-
ok "Global git hook installed (AI client auto-detected on every commit) 全局 git hook 已安装(每次提交自动检测 AI 客户端)"
|
|
1100
|
-
;;
|
|
1101
|
-
remove)
|
|
1102
|
-
git config --global --unset core.hooksPath 2>/dev/null && \
|
|
1103
|
-
ok "Removed core.hooksPath from global git config 已从全局 git 配置中移除 core.hooksPath" || \
|
|
1104
|
-
info "core.hooksPath was not set core.hooksPath 未设置"
|
|
1105
|
-
;;
|
|
1106
|
-
*)
|
|
1107
|
-
err "Unknown hooks subcommand: $subcmd 未知 hooks 子命令: $subcmd"
|
|
1108
|
-
echo "Usage: roll hook [install|remove] 用法: roll hook [install|remove]"
|
|
1109
|
-
exit 1
|
|
1110
|
-
;;
|
|
1111
|
-
esac
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
1046
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
1115
1047
|
# COMMAND: status
|
|
1116
1048
|
# Show current state of conventions
|
|
@@ -1217,20 +1149,6 @@ cmd_status() {
|
|
|
1217
1149
|
warn "No AI tools configured — check ~/.roll/config.yaml 未配置 AI 工具 — 请检查 ~/.roll/config.yaml"
|
|
1218
1150
|
fi
|
|
1219
1151
|
|
|
1220
|
-
echo ""
|
|
1221
|
-
echo -e "${BOLD}Git hook: Git Hook${NC}"
|
|
1222
|
-
local hook_dst="$HOME/.config/git/hooks/prepare-commit-msg"
|
|
1223
|
-
local hooks_path
|
|
1224
|
-
hooks_path=$(git config --global core.hooksPath 2>/dev/null || true)
|
|
1225
|
-
if [[ -f "$hook_dst" ]] && [[ "$hooks_path" == "$HOME/.config/git/hooks" ]]; then
|
|
1226
|
-
echo -e " ${GREEN}+${NC} prepare-commit-msg (global, AI client auto-detect / 全局,自动检测 AI 客户端)"
|
|
1227
|
-
elif [[ -f "$hook_dst" ]]; then
|
|
1228
|
-
echo -e " ${YELLOW}~${NC} prepare-commit-msg exists but core.hooksPath not set prepare-commit-msg 已存在,但 core.hooksPath 未设置"
|
|
1229
|
-
echo -e " run: roll hook install 运行: roll hook install"
|
|
1230
|
-
else
|
|
1231
|
-
echo -e " ${RED}-${NC} not installed (optional) — run 'roll hook install' 未安装(可选)— 运行 'roll hook install'"
|
|
1232
|
-
fi
|
|
1233
|
-
|
|
1234
1152
|
echo ""
|
|
1235
1153
|
echo -e "${BOLD}Templates: 模板${NC}"
|
|
1236
1154
|
for tpl in fullstack frontend-only backend-service cli; do
|
|
@@ -1289,14 +1207,13 @@ usage() {
|
|
|
1289
1207
|
echo " setup [-f] [Machine] First-time install or re-sync 首次安装或重新同步"
|
|
1290
1208
|
echo " update [Upgrade] npm install latest + re-sync 一键升级到最新版"
|
|
1291
1209
|
echo " init [Project] Create AGENTS.md + BACKLOG.md + docs/ 初始化项目工作流文件"
|
|
1292
|
-
echo " hook [install|remove] [Optional] Manage global git hook 管理全局 git hook"
|
|
1293
1210
|
echo " status [Diagnostic] Show current state 显示当前状态"
|
|
1294
1211
|
echo ""
|
|
1295
1212
|
echo "Examples / 示例:"
|
|
1296
1213
|
echo " roll setup # New machine: first-time install 新机器首次安装"
|
|
1297
1214
|
echo " roll update # Upgrade to latest version + re-sync 升级到最新版并重新同步"
|
|
1298
1215
|
echo " roll init # New or re-merge project (run in project) 新建或重新合并(项目目录)"
|
|
1299
|
-
|
|
1216
|
+
|
|
1300
1217
|
}
|
|
1301
1218
|
|
|
1302
1219
|
main() {
|
|
@@ -1307,7 +1224,6 @@ main() {
|
|
|
1307
1224
|
setup) cmd_setup "$@" ;;
|
|
1308
1225
|
update) cmd_update "$@" ;;
|
|
1309
1226
|
init) cmd_init "$@" ;;
|
|
1310
|
-
hook) cmd_hook "$@" ;;
|
|
1311
1227
|
status) cmd_status "$@" ;;
|
|
1312
1228
|
version|--version|-v) echo "roll v${VERSION}" ;;
|
|
1313
1229
|
help|--help|-h|"") usage ;;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seanyao/roll",
|
|
3
|
-
"version": "2026.506.
|
|
3
|
+
"version": "2026.506.3",
|
|
4
4
|
"description": "Roll — Roll out features with AI agents",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "find tests/unit tests/integration -name '*.bats' | sort | xargs ./tests/helpers/bats-core/bin/bats"
|