@seanyao/roll 2026.503.7 → 2026.505.1

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 CHANGED
@@ -48,7 +48,8 @@ roll setup
48
48
  To update:
49
49
 
50
50
  ```bash
51
- roll update
51
+ npm install -g @seanyao/roll@latest
52
+ roll setup
52
53
  ```
53
54
 
54
55
  > **For contributors** (working on roll itself): `git clone https://github.com/seanyao/roll.git && cd roll && ./install.sh`
@@ -63,26 +64,24 @@ Unified behavioral conventions for Claude Code / Gemini CLI / Cursor / Codex —
63
64
 
64
65
  | Command | Description |
65
66
  |---------|-------------|
66
- | `roll setup` | First-time install: create `~/.roll/` + sync to all AI tools |
67
- | `roll update` | Update roll to latest version + re-sync |
68
- | `roll sync` | Re-sync conventions and skill symlinks to all AI tools |
67
+ | `roll setup` | First-time install on this machine, or re-sync after editing `~/.roll/config.yaml` (use `--force` to overwrite local cache) |
69
68
  | `roll init` | New project: create `AGENTS.md` + `BACKLOG.md` + `docs/features/` |
70
- | `roll hook install` | Optional: global git hook for AI client auto-detection |
71
- | `roll reset` | Force-rebuild local cache from repo source, then re-sync |
69
+ | `roll hook install` | Optional: global git hook that tags commits with the active AI client |
72
70
  | `roll status` | Show sync state, skill links, and detected AI tools |
73
71
 
74
72
  ### Typical Flow
75
73
 
76
74
  ```bash
77
- # 1. Install
78
- ./install.sh
75
+ # 1. Install on this machine
76
+ npm install -g @seanyao/roll
77
+ roll setup
79
78
 
80
79
  # 2. Initialize a project (run from project root)
81
80
  cd my-app
82
81
  roll init
83
82
 
84
- # 3. Re-sync after editing ~/.roll/config.yaml
85
- roll sync
83
+ # 3. Re-sync after editing ~/.roll/config.yaml or after upgrading
84
+ roll setup
86
85
 
87
86
  # 4. Optional: tag commits with AI client name
88
87
  roll hook install
@@ -120,7 +119,7 @@ Global conventions are additive and never overwrite existing files. Project conv
120
119
 
121
120
  ## Skill System
122
121
 
123
- Skills are instructions that encode proven engineering practices into a form AI agents can reliably follow. They live in `~/.roll/skills/` and are symlinked into each AI client's skill directory on `roll sync`.
122
+ Skills are instructions that encode proven engineering practices into a form AI agents can reliably follow. They live in `~/.roll/skills/` and are symlinked into each AI client's skill directory on `roll setup`.
124
123
 
125
124
  ### Workflow
126
125
 
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.503.7"
7
+ VERSION="2026.505.1"
8
8
  ROLL_HOME="${ROLL_HOME:-${HOME}/.roll}"
9
9
  ROLL_CONFIG="${ROLL_HOME}/config.yaml"
10
10
  ROLL_GLOBAL="${ROLL_HOME}/conventions/global"
@@ -196,6 +196,27 @@ safe_copy() {
196
196
  ok "Wrote: ${dst/#$HOME/~} 已写入: ${dst/#$HOME/~}"
197
197
  }
198
198
 
199
+ # ─── Internal: prune files in $1 that no longer exist in $2 ──────────────────
200
+ # Used to clean up stale files left behind when a previous version had them
201
+ # but the current package no longer ships them.
202
+ _prune_dir() {
203
+ local installed_dir="$1"
204
+ local source_dir="$2"
205
+ local label="${3:-file}"
206
+ [[ -d "$installed_dir" ]] || return 0
207
+
208
+ local installed_f installed_fname
209
+ for installed_f in "$installed_dir"/* "$installed_dir"/.*; do
210
+ [[ -f "$installed_f" ]] || continue
211
+ installed_fname="$(basename "$installed_f")"
212
+ [[ "$installed_fname" == "." || "$installed_fname" == ".." ]] && continue
213
+ if [[ ! -f "$source_dir/$installed_fname" ]]; then
214
+ rm -f "$installed_f"
215
+ info "Removed stale $label: ${installed_dir##*/}/$installed_fname 已删除过时$label: ${installed_dir##*/}/$installed_fname"
216
+ fi
217
+ done
218
+ }
219
+
199
220
  # ─── Internal: pull skills from repo → ~/.roll/skills ──────────────────────
200
221
  _pull_skills() {
201
222
  if [[ ! -d "$ROLL_PKG_DIR/skills" ]]; then
@@ -214,6 +235,8 @@ _pull_skills() {
214
235
  for f in "$skill_dir"*; do
215
236
  [[ -f "$f" ]] && cp "$f" "$ROLL_HOME/skills/$skill_name/$(basename "$f")"
216
237
  done
238
+ # File-level prune (dir-level prune below catches whole-skill removals)
239
+ _prune_dir "$ROLL_HOME/skills/$skill_name" "$skill_dir" "skill file"
217
240
  fi
218
241
  done
219
242
 
@@ -250,6 +273,8 @@ _pull_conventions() {
250
273
  [[ -f "$f" ]] && [[ "$(basename "$f")" != "." ]] && [[ "$(basename "$f")" != ".." ]] && \
251
274
  safe_copy "$f" "$ROLL_GLOBAL/$(basename "$f")" "$force"
252
275
  done
276
+ # Prune stale files in ~/.roll/conventions/global/
277
+ _prune_dir "$ROLL_GLOBAL" "$ROLL_PKG_CONVENTIONS/global" "convention"
253
278
 
254
279
  info "Copying project templates... 正在复制项目模板..."
255
280
  for tpl_dir in "$ROLL_PKG_CONVENTIONS"/templates/*/; do
@@ -262,6 +287,8 @@ _pull_conventions() {
262
287
  [[ -f "$f" ]] && [[ "$(basename "$f")" != "." ]] && [[ "$(basename "$f")" != ".." ]] && \
263
288
  safe_copy "$f" "$ROLL_TEMPLATES/$tpl_name/$(basename "$f")" "$force"
264
289
  done
290
+ # Prune stale files in this template dir
291
+ _prune_dir "$ROLL_TEMPLATES/$tpl_name" "$tpl_dir" "template file"
265
292
  done
266
293
  }
267
294
 
@@ -291,7 +318,7 @@ _install_local() {
291
318
  info "Creating default config... 正在创建默认配置..."
292
319
  cat > "$ROLL_CONFIG" << 'YAML'
293
320
  # Roll Configuration
294
- # Edit this file, then run `roll sync` to apply.
321
+ # Edit this file, then run `roll setup` to apply.
295
322
 
296
323
  # AI tools — each entry controls both convention sync and skill linking
297
324
  # Format: <name>: <dir>|<config_file>|<convention_src>
@@ -514,37 +541,6 @@ cmd_setup() {
514
541
  info "Next: run ${BOLD}roll init${NC} inside a project to initialize it. 下一步:在项目目录运行 roll init"
515
542
  }
516
543
 
517
- # ═══════════════════════════════════════════════════════════════════════════════
518
- # COMMAND: sync [--force]
519
- # Full pipeline: repo → ~/.roll/ → AI tool config paths
520
- # Pulls latest conventions from repo, then distributes to all AI tools.
521
- # ═══════════════════════════════════════════════════════════════════════════════
522
- cmd_sync() {
523
- if [[ ! -d "$ROLL_HOME" ]]; then
524
- err "~/.roll/ not found. Run 'roll setup' first. ~/.roll/ 不存在,请先运行 'roll setup'。"
525
- exit 1
526
- fi
527
-
528
- local force=false
529
- while [[ $# -gt 0 ]]; do
530
- case "$1" in
531
- --force|-f) force=true; shift ;;
532
- *) err "Unknown sync argument: $1 未知同步参数: $1"; exit 1 ;;
533
- esac
534
- done
535
-
536
- info "Syncing from repo to AI tools... 正在从仓库同步到 AI 工具..."
537
- echo ""
538
- _pull_conventions "$force"
539
- _ensure_config_entries
540
- echo ""
541
- _sync_conventions "$force"
542
- echo ""
543
- _sync_skills "$force"
544
- echo ""
545
- ok "Sync complete. 同步完成。"
546
- }
547
-
548
544
  # ─── Helper: merge global AGENTS.md into project (no type prompt) ────────────
549
545
  # Fresh project: copies global AGENTS.md.
550
546
  # Existing AGENTS.md: appends any ## sections missing from global.
@@ -1007,46 +1003,6 @@ cmd_hook() {
1007
1003
  esac
1008
1004
  }
1009
1005
 
1010
- # ═══════════════════════════════════════════════════════════════════════════════
1011
- # COMMAND: reset
1012
- # Re-copy conventions and skills from repo source, force-sync everything
1013
- # ═══════════════════════════════════════════════════════════════════════════════
1014
- cmd_reset() {
1015
- warn "This will overwrite ~/.roll/conventions/ and skills with repo defaults. 此操作将用仓库默认值覆盖 ~/.roll/conventions/ 和技能。"
1016
- echo -n " Continue? [y/N] "
1017
- read -r answer
1018
- [[ "$answer" =~ ^[Yy]$ ]] || { info "Aborted. 已取消。"; return; }
1019
-
1020
- echo ""
1021
- info "Resetting and force-syncing... 正在重置并强制同步..."
1022
- cmd_setup --force
1023
- }
1024
-
1025
- # ═══════════════════════════════════════════════════════════════════════════════
1026
- # COMMAND: update
1027
- # Update roll to latest version (npm update or git pull), then re-sync
1028
- # ═══════════════════════════════════════════════════════════════════════════════
1029
- _is_git_install() {
1030
- [[ -d "$ROLL_PKG_DIR/.git" ]]
1031
- }
1032
-
1033
- cmd_update() {
1034
- info "Current version: roll v${VERSION} 当前版本: roll v${VERSION}"
1035
- echo ""
1036
-
1037
- if _is_git_install; then
1038
- info "Git install detected — pulling latest... 检测到 Git 安装,正在拉取最新代码..."
1039
- git -C "$ROLL_PKG_DIR" pull
1040
- else
1041
- info "npm install detected — updating package... 检测到 npm 安装,正在更新包..."
1042
- npm update -g @seanyao/roll
1043
- fi
1044
-
1045
- echo ""
1046
- info "Re-syncing to AI tools... 正在重新同步到 AI 工具..."
1047
- cmd_sync
1048
- }
1049
-
1050
1006
  # ═══════════════════════════════════════════════════════════════════════════════
1051
1007
  # COMMAND: status
1052
1008
  # Show current state of conventions
@@ -1222,17 +1178,13 @@ usage() {
1222
1178
  echo "用法: roll <command> [options]"
1223
1179
  echo ""
1224
1180
  echo "Commands:"
1225
- echo " setup [-f] [Machine] First-time install: init ~/.roll/ + sync 首次安装:初始化 ~/.roll/ 并同步"
1226
- echo " update [Upgrade] Update roll to latest + re-sync 更新 roll 到最新版本并重新同步"
1227
- echo " sync [-f] [Everyday] package → ~/.roll/ → AI tools 日常同步:从包同步到所有工具"
1181
+ echo " setup [-f] [Machine] First-time install or re-sync 首次安装或重新同步"
1228
1182
  echo " init [Project] Create AGENTS.md + BACKLOG.md + docs/ 初始化项目工作流文件"
1229
1183
  echo " hook [install|remove] [Optional] Manage global git hook 管理全局 git hook"
1230
1184
  echo " status [Diagnostic] Show current state 显示当前状态"
1231
- echo " reset [Recovery] Force-rebuild from package source 强制从包源重建"
1232
1185
  echo ""
1233
1186
  echo "Examples / 示例:"
1234
- echo " roll setup # New machine: first-time install 新机器:首次安装"
1235
- echo " roll update # Get latest version + sync to AI tools 更新到最新版本并同步"
1187
+ echo " roll setup # New machine, or re-sync after npm update 新机器或更新后重新同步"
1236
1188
  echo " roll init # New or re-merge project (run in project) 新建或重新合并(项目目录)"
1237
1189
  echo " roll hook install # Optional: tag commits with AI client 可选:提交时标记 AI 工具"
1238
1190
  }
@@ -1243,11 +1195,8 @@ main() {
1243
1195
 
1244
1196
  case "$cmd" in
1245
1197
  setup) cmd_setup "$@" ;;
1246
- sync) cmd_sync "$@" ;;
1247
1198
  init) cmd_init "$@" ;;
1248
- hook) cmd_hook "$@" ;;
1249
- update) cmd_update "$@" ;;
1250
- reset) cmd_reset "$@" ;;
1199
+ hook) cmd_hook "$@" ;;
1251
1200
  status) cmd_status "$@" ;;
1252
1201
  version|--version|-v) echo "roll v${VERSION}" ;;
1253
1202
  help|--help|-h|"") usage ;;
@@ -1284,7 +1233,7 @@ _notify_update() {
1284
1233
  local latest; latest=$(awk '{print $2}' "$cache" 2>/dev/null || true)
1285
1234
  [[ -z "$latest" || "$latest" == "$VERSION" ]] && return
1286
1235
  echo ""
1287
- warn "v${latest} available — run 'roll update' to upgrade 有新版本 v${latest} — 运行 'roll update' 升级"
1236
+ warn "v${latest} available — run 'npm install -g @seanyao/roll@latest && roll setup' to upgrade 有新版本 v${latest} — 运行 'npm install -g @seanyao/roll@latest && roll setup' 升级"
1288
1237
  }
1289
1238
 
1290
1239
  if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
@@ -6,11 +6,22 @@
6
6
  - User's language. Code/Git/Comments: English. UI: Chinese.
7
7
  - Concise. No summaries/code-walking. Implementation invisible.
8
8
  - Strategy (Why) OK; Tactics (How) NO. Outcomes only.
9
+ - **Ambiguity resolution**: When user says "explicit" in automation contexts,
10
+ interpret as "logged/observable with clear output", NOT "requiring manual
11
+ intervention". Confirm with one question if uncertain.
12
+ - **Bilingual output**: EN + ZH on separate lines, never inline.
13
+ ```
14
+ Processing...
15
+ 处理中...
16
+ ```
17
+ Not: `Processing... 处理中...`
9
18
 
10
19
  ## 2. Code
11
20
  - **TS**: Strict, no `any`. Functional hooks. Early returns.
12
21
  - **Git**: No force-push main. No `--no-verify`. No secrets in git.
22
+ - **Identity**: When you need the user's name or email, read it dynamically — `git config user.name` / `git config user.email`. **Never hardcode personal data** (names, emails, machine paths, personal repo URLs) into files that get committed or shipped via npm. Author/repo metadata in `package.json` is the only allowed exception.
13
23
  - **Behavior**: No unrelated refactoring. No speculative abstractions.
24
+ - **File ops**: Prefer targeted edits over full file rewrites. Verify file exists before modifying.
14
25
 
15
26
  ## 3. Engineering
16
27
  - **Idempotency**: Same op N times = same result.
@@ -20,5 +31,45 @@
20
31
 
21
32
  ## 4. Workflow
22
33
  - **TCR**: Test -> Green = Commit / Red = Revert. No WIP commits.
34
+ - Before implementing: confirm exact files, test strategy, and commit message
35
+ draft with user. Do not write code until approved.
36
+ - Before claiming completion: verify in the target environment mentioned by
37
+ user (e.g., specific CLI tool, remote server, hardware platform).
23
38
  - **Workspace**: `BACKLOG.md` index. `docs/features/` for details.
24
39
  - **Done**: Push + CI passes + deployed. Local-only is not done.
40
+ - **Commit message format**:
41
+ - Format: `<type>: <description>` (Git Hook may auto-prepend type prefix)
42
+ - Types: `Story N`, `Fix`, `Refactor`, `Docs`, `Chore`
43
+ - TCR micro-commits use `tcr:` prefix instead
44
+
45
+ ## 5. Refactoring & Renames
46
+
47
+ Project-wide renames require systematic checking. Never assume find/replace
48
+ is sufficient. Execute in order:
49
+
50
+ 1. **Code references** — imports, function names, string literals
51
+ 2. **Documentation** — README, methodology, API docs
52
+ 3. **Config files** — YAML frontmatter, package names, manifests
53
+ 4. **Symlinks** — verify all resolve after rename
54
+ 5. **Installer scripts** — update paths and references
55
+ 6. **Shell environment** — remind user to reload or restart sessions
56
+
57
+ Confirm each phase clean before proceeding to the next.
58
+
59
+ ## 6. Configuration & External Services
60
+ - **Config file editing** (YAML/TOML/JSON with schema):
61
+ 1. Find official documentation or a verified working example first
62
+ 2. Do not guess syntax
63
+ 3. If no docs found after 2 searches, ask user for a reference config
64
+ 4. Maximum 2 syntax attempts before escalating to research mode
65
+ - **External services** (npm publishing, proxy, auth-dependent deploy):
66
+ - Stop after 2 failed attempts and ask user for preferred fallback
67
+ - Do not continue iterating on auth/proxy debugging without explicit direction
68
+ - If OIDC/token issues persist, immediately fallback to manual with explanation
69
+
70
+ ## 7. Frontend Default Stack
71
+ - React + shadcn/ui + Tailwind CSS is the default.
72
+ - Use shadcn/ui components first. Custom components only when shadcn doesn't cover it.
73
+ - `components/ui/` is shadcn-generated — never edit manually.
74
+ - Tailwind utility classes only. No inline styles, no CSS modules.
75
+ - Icons: Lucide React.
@@ -3,18 +3,6 @@
3
3
  > Extends [AGENTS.md](./AGENTS.md) — read that first for shared conventions.
4
4
  > This file adds Claude Code-specific configuration only.
5
5
 
6
- ## Identity
7
-
8
- - Git: `Sean Yao <sean.dlut@gmail.com>`
9
- - Default branch: `main`
10
-
11
- ## Commit Message Format
12
-
13
- - Format: `<type>: <description>` (遵循 Git Hook 自动生成的前缀)
14
- - TCR micro-commits: `tcr: <description>` (No prefix)
15
- - Types: Story N, Fix, Refactor, Docs, Chore
16
- - Example: `Story 7: Review assignment by org structure`
17
-
18
6
  ## Claude Code-Specific
19
7
 
20
8
  - When a project has Roll skills, use them (`$roll-design`, `$roll-build`, `$roll-fix`, etc.).
@@ -22,11 +10,3 @@
22
10
  - Prefer Edit tool over Bash for file modifications.
23
11
  - Use Agent tool with worktree isolation for parallel independent subtasks.
24
12
  - When I say "帮我看下" or "处理下", go ahead and do it, not just analyze it.
25
-
26
- ## Frontend Default Stack
27
-
28
- - React + shadcn/ui + Tailwind CSS is the default.
29
- - Use shadcn/ui components first. Custom components only when shadcn doesn't cover it.
30
- - `components/ui/` is shadcn-generated — never edit manually.
31
- - Tailwind utility classes only. No inline styles, no CSS modules.
32
- - Icons: Lucide React.
@@ -3,26 +3,7 @@
3
3
  > Extends AGENTS.md in this directory — read that first for shared conventions.
4
4
  > This file adds Gemini CLI-specific configuration only.
5
5
 
6
- ## Identity
7
-
8
- - Git: `Sean Yao <sean.dlut@gmail.com>`
9
- - Default branch: `main`
10
-
11
- ## Commit Message Format
12
-
13
- - Format: `<type>: <description>` (遵循 Git Hook 自动生成的前缀)
14
- - TCR micro-commits: `tcr: <description>` (No prefix)
15
- - Types: Story N, Fix, Refactor, Docs, Chore
16
-
17
6
  ## Gemini-Specific
18
7
 
19
8
  - When running shell commands, prefer the most specific tool available.
20
- - For file operations, verify the file exists before modifying.
21
9
  - When a project has Roll workflow, follow the AGENTS.md conventions and use Roll skills.
22
- - Prefer targeted edits over full file rewrites.
23
-
24
- ## Frontend Default Stack
25
-
26
- - React + shadcn/ui + Tailwind CSS is the default.
27
- - Use shadcn/ui components first. Custom only when shadcn doesn't cover it.
28
- - Tailwind utility classes only. No inline styles, no CSS modules.
@@ -3,26 +3,7 @@
3
3
  > Extends AGENTS.md in this directory — read that first for shared conventions.
4
4
  > This file adds Trae IDE-specific configuration only.
5
5
 
6
- ## Identity
7
-
8
- - Git: `Sean Yao <sean.dlut@gmail.com>`
9
- - Default branch: `main`
10
-
11
- ## Commit Message Format
12
-
13
- - Format: `<type>: <description>` (遵循 Git Hook 自动生成的前缀)
14
- - TCR micro-commits: `tcr: <description>` (No prefix)
15
- - Types: Story N, Fix, Refactor, Docs, Chore
16
-
17
6
  ## Trae-Specific
18
7
 
19
8
  - When a project has Roll workflow, follow the AGENTS.md conventions and use Roll skills.
20
9
  - Use Solo mode for complex multi-step tasks.
21
- - Prefer targeted edits over full file rewrites.
22
- - For file operations, verify the file exists before modifying.
23
-
24
- ## Frontend Default Stack
25
-
26
- - React + shadcn/ui + Tailwind CSS is the default.
27
- - Use shadcn/ui components first. Custom only when shadcn doesn't cover it.
28
- - Tailwind utility classes only. No inline styles, no CSS modules.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "2026.503.7",
3
+ "version": "2026.505.1",
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"
@@ -21,7 +21,7 @@
21
21
  "roll": "bin/roll"
22
22
  },
23
23
  "license": "MIT",
24
- "author": "Sean Yao <seanyao@gmail.com>",
24
+ "author": "Sean Yao <sean.dlut@gmail.com>",
25
25
  "files": [
26
26
  "bin/",
27
27
  "conventions/",
@@ -2,6 +2,8 @@
2
2
  hidden: true
3
3
  name: roll-.changelog
4
4
  license: MIT
5
+ model: haiku
6
+ allowed-tools: "Read, Edit, Write, Bash(git:*)"
5
7
  description: After build completion, extracts completed Stories from BACKLOG.md to generate CHANGELOG.md. Auto-triggered after successful deploy, keeping the external changelog in sync with the internal backlog.
6
8
  ---
7
9
 
@@ -2,6 +2,7 @@
2
2
  hidden: true
3
3
  name: roll-.qa
4
4
  license: MIT
5
+ allowed-tools: "Read"
5
6
  description: QA coverage reference for build skills. Defines test pyramid (unit/E2E/visual/smoke), coverage requirements, and CI gates. Ensures quality assurance across all testing layers.
6
7
  ---
7
8
 
@@ -2,6 +2,8 @@
2
2
  hidden: true
3
3
  name: roll-.review
4
4
  license: MIT
5
+ model: sonnet
6
+ allowed-tools: "Read, Bash(git:*)"
5
7
  description: Self code review step in the TCR workflow. Runs after each micro-step is completed and before commit, checking code quality, security, and design issues.
6
8
  ---
7
9