@seanyao/roll 2026.506.1 → 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 -108
- package/conventions/global/AGENTS.md +4 -0
- 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"
|
|
@@ -64,28 +64,6 @@ lower_name() {
|
|
|
64
64
|
echo "$1" | tr '[:upper:]' '[:lower:]'
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
# Detect AI client by walking the process tree (innermost match wins).
|
|
68
|
-
# Returns empty string if no known AI client is found.
|
|
69
|
-
_detect_ai_client() {
|
|
70
|
-
local pid=$$ depth=0 cmd
|
|
71
|
-
while [[ "$pid" -gt 1 ]] && [[ "$depth" -lt 15 ]]; do
|
|
72
|
-
cmd=$(ps -p "$pid" -o comm= 2>/dev/null | tr '[:upper:]' '[:lower:]' || true)
|
|
73
|
-
case "$cmd" in
|
|
74
|
-
*opencode*) echo "opencode"; return ;;
|
|
75
|
-
*claude*) echo "claude code"; return ;;
|
|
76
|
-
*kimi*) echo "kimi cli"; return ;;
|
|
77
|
-
*gemini*) echo "gemini cli"; return ;;
|
|
78
|
-
*codex*) echo "codex"; return ;;
|
|
79
|
-
*cursor*) echo "cursor"; return ;;
|
|
80
|
-
esac
|
|
81
|
-
local ppid
|
|
82
|
-
ppid=$(ps -p "$pid" -o ppid= 2>/dev/null | tr -d ' ' || true)
|
|
83
|
-
[[ "$ppid" == "$pid" ]] && break
|
|
84
|
-
pid=$ppid
|
|
85
|
-
depth=$((depth + 1))
|
|
86
|
-
done
|
|
87
|
-
echo ""
|
|
88
|
-
}
|
|
89
67
|
|
|
90
68
|
# Check if an AI tool is actually installed.
|
|
91
69
|
# Most tools create their own config dir; Trae on macOS uses Library/Application Support
|
|
@@ -553,19 +531,6 @@ cmd_setup() {
|
|
|
553
531
|
echo ""
|
|
554
532
|
ok "Setup complete. 初始化完成。"
|
|
555
533
|
|
|
556
|
-
# Offer git hook install if not already installed (interactive terminals only)
|
|
557
|
-
local hook_dst="$HOME/.config/git/hooks/prepare-commit-msg"
|
|
558
|
-
local hooks_path
|
|
559
|
-
hooks_path=$(git config --global core.hooksPath 2>/dev/null || true)
|
|
560
|
-
if [[ -t 0 ]] && { [[ ! -f "$hook_dst" ]] || [[ "$hooks_path" != "$HOME/.config/git/hooks" ]]; }; then
|
|
561
|
-
echo ""
|
|
562
|
-
echo -n " Install global git hook (tags commits with AI client)? [y/N] "
|
|
563
|
-
read -r _hook_ans
|
|
564
|
-
if [[ "${_hook_ans:-N}" =~ ^[Yy]$ ]]; then
|
|
565
|
-
cmd_hook install
|
|
566
|
-
fi
|
|
567
|
-
fi
|
|
568
|
-
|
|
569
534
|
echo ""
|
|
570
535
|
info "Next: run ${BOLD}roll init${NC} inside a project to initialize it. 下一步:在项目目录运行 roll init"
|
|
571
536
|
}
|
|
@@ -1078,61 +1043,6 @@ detect_project_type() {
|
|
|
1078
1043
|
fi
|
|
1079
1044
|
}
|
|
1080
1045
|
|
|
1081
|
-
|
|
1082
|
-
# ═══════════════════════════════════════════════════════════════════════════════
|
|
1083
|
-
# COMMAND: hooks <subcommand>
|
|
1084
|
-
# Manage the global git hook (opt-in — modifies git global config)
|
|
1085
|
-
# ═══════════════════════════════════════════════════════════════════════════════
|
|
1086
|
-
cmd_hook() {
|
|
1087
|
-
local subcmd="${1:-install}"
|
|
1088
|
-
|
|
1089
|
-
case "$subcmd" in
|
|
1090
|
-
install)
|
|
1091
|
-
local hooks_dir="$HOME/.config/git/hooks"
|
|
1092
|
-
local hook_src="$ROLL_PKG_DIR/hooks/prepare-commit-msg"
|
|
1093
|
-
local hook_dst="$hooks_dir/prepare-commit-msg"
|
|
1094
|
-
|
|
1095
|
-
if [[ ! -f "$hook_src" ]]; then
|
|
1096
|
-
err "Hook source not found: $hook_src Hook 源文件未找到: $hook_src"
|
|
1097
|
-
exit 1
|
|
1098
|
-
fi
|
|
1099
|
-
|
|
1100
|
-
local current_hooks_path
|
|
1101
|
-
current_hooks_path=$(git config --global core.hooksPath 2>/dev/null || echo "(not set)")
|
|
1102
|
-
|
|
1103
|
-
echo ""
|
|
1104
|
-
warn "This will modify your global git configuration: 此操作将修改您的全局 git 配置:"
|
|
1105
|
-
echo " git config --global core.hooksPath $hooks_dir"
|
|
1106
|
-
echo ""
|
|
1107
|
-
echo " Current value: $current_hooks_path 当前值: $current_hooks_path"
|
|
1108
|
-
echo ""
|
|
1109
|
-
if [[ "$current_hooks_path" != "(not set)" ]] && [[ "$current_hooks_path" != "$hooks_dir" ]]; then
|
|
1110
|
-
warn "WARNING: Hooks at '$current_hooks_path' will stop running after this change. 警告:此更改后 '$current_hooks_path' 处的 hooks 将不再运行。"
|
|
1111
|
-
echo ""
|
|
1112
|
-
fi
|
|
1113
|
-
echo -n " Proceed? [y/N] "
|
|
1114
|
-
read -r answer
|
|
1115
|
-
[[ "$answer" =~ ^[Yy]$ ]] || { info "Aborted. 已取消。"; return; }
|
|
1116
|
-
|
|
1117
|
-
mkdir -p "$hooks_dir"
|
|
1118
|
-
cp "$hook_src" "$hook_dst"
|
|
1119
|
-
chmod +x "$hook_dst"
|
|
1120
|
-
git config --global core.hooksPath "$hooks_dir"
|
|
1121
|
-
ok "Global git hook installed (AI client auto-detected on every commit) 全局 git hook 已安装(每次提交自动检测 AI 客户端)"
|
|
1122
|
-
;;
|
|
1123
|
-
remove)
|
|
1124
|
-
git config --global --unset core.hooksPath 2>/dev/null && \
|
|
1125
|
-
ok "Removed core.hooksPath from global git config 已从全局 git 配置中移除 core.hooksPath" || \
|
|
1126
|
-
info "core.hooksPath was not set core.hooksPath 未设置"
|
|
1127
|
-
;;
|
|
1128
|
-
*)
|
|
1129
|
-
err "Unknown hooks subcommand: $subcmd 未知 hooks 子命令: $subcmd"
|
|
1130
|
-
echo "Usage: roll hook [install|remove] 用法: roll hook [install|remove]"
|
|
1131
|
-
exit 1
|
|
1132
|
-
;;
|
|
1133
|
-
esac
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
1046
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
1137
1047
|
# COMMAND: status
|
|
1138
1048
|
# Show current state of conventions
|
|
@@ -1239,20 +1149,6 @@ cmd_status() {
|
|
|
1239
1149
|
warn "No AI tools configured — check ~/.roll/config.yaml 未配置 AI 工具 — 请检查 ~/.roll/config.yaml"
|
|
1240
1150
|
fi
|
|
1241
1151
|
|
|
1242
|
-
echo ""
|
|
1243
|
-
echo -e "${BOLD}Git hook: Git Hook${NC}"
|
|
1244
|
-
local hook_dst="$HOME/.config/git/hooks/prepare-commit-msg"
|
|
1245
|
-
local hooks_path
|
|
1246
|
-
hooks_path=$(git config --global core.hooksPath 2>/dev/null || true)
|
|
1247
|
-
if [[ -f "$hook_dst" ]] && [[ "$hooks_path" == "$HOME/.config/git/hooks" ]]; then
|
|
1248
|
-
echo -e " ${GREEN}+${NC} prepare-commit-msg (global, AI client auto-detect / 全局,自动检测 AI 客户端)"
|
|
1249
|
-
elif [[ -f "$hook_dst" ]]; then
|
|
1250
|
-
echo -e " ${YELLOW}~${NC} prepare-commit-msg exists but core.hooksPath not set prepare-commit-msg 已存在,但 core.hooksPath 未设置"
|
|
1251
|
-
echo -e " run: roll hook install 运行: roll hook install"
|
|
1252
|
-
else
|
|
1253
|
-
echo -e " ${RED}-${NC} not installed (optional) — run 'roll hook install' 未安装(可选)— 运行 'roll hook install'"
|
|
1254
|
-
fi
|
|
1255
|
-
|
|
1256
1152
|
echo ""
|
|
1257
1153
|
echo -e "${BOLD}Templates: 模板${NC}"
|
|
1258
1154
|
for tpl in fullstack frontend-only backend-service cli; do
|
|
@@ -1311,14 +1207,13 @@ usage() {
|
|
|
1311
1207
|
echo " setup [-f] [Machine] First-time install or re-sync 首次安装或重新同步"
|
|
1312
1208
|
echo " update [Upgrade] npm install latest + re-sync 一键升级到最新版"
|
|
1313
1209
|
echo " init [Project] Create AGENTS.md + BACKLOG.md + docs/ 初始化项目工作流文件"
|
|
1314
|
-
echo " hook [install|remove] [Optional] Manage global git hook 管理全局 git hook"
|
|
1315
1210
|
echo " status [Diagnostic] Show current state 显示当前状态"
|
|
1316
1211
|
echo ""
|
|
1317
1212
|
echo "Examples / 示例:"
|
|
1318
1213
|
echo " roll setup # New machine: first-time install 新机器首次安装"
|
|
1319
1214
|
echo " roll update # Upgrade to latest version + re-sync 升级到最新版并重新同步"
|
|
1320
1215
|
echo " roll init # New or re-merge project (run in project) 新建或重新合并(项目目录)"
|
|
1321
|
-
|
|
1216
|
+
|
|
1322
1217
|
}
|
|
1323
1218
|
|
|
1324
1219
|
main() {
|
|
@@ -1329,7 +1224,6 @@ main() {
|
|
|
1329
1224
|
setup) cmd_setup "$@" ;;
|
|
1330
1225
|
update) cmd_update "$@" ;;
|
|
1331
1226
|
init) cmd_init "$@" ;;
|
|
1332
|
-
hook) cmd_hook "$@" ;;
|
|
1333
1227
|
status) cmd_status "$@" ;;
|
|
1334
1228
|
version|--version|-v) echo "roll v${VERSION}" ;;
|
|
1335
1229
|
help|--help|-h|"") usage ;;
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
- **Testing**: Unit >80%. E2E for flows. No DB mocks.
|
|
31
31
|
|
|
32
32
|
## 4. Workflow
|
|
33
|
+
- **Scope Gate**: Only implement what is explicitly listed in the AC. Nothing more.
|
|
34
|
+
- Requests made in conversation are NOT AC — capture with `roll-jot` first.
|
|
35
|
+
- Any new Story/Fix requires design doc + user confirmation before TCR starts.
|
|
36
|
+
- Do not commit without user approval unless explicitly told to auto-commit.
|
|
33
37
|
- **TCR**: Test -> Green = Commit / Red = Revert. No WIP commits.
|
|
34
38
|
- Before implementing: confirm exact files, test strategy, and commit message
|
|
35
39
|
draft with user. Do not write code until approved.
|
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"
|