@seanyao/roll 0.5.0 → 2.602.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.
Files changed (181) hide show
  1. package/CHANGELOG.md +717 -0
  2. package/LICENSE +21 -0
  3. package/README.md +65 -165
  4. package/bin/dream-test-quality-scan +110 -0
  5. package/bin/roll +14897 -815
  6. package/conventions/config.yaml +17 -1
  7. package/conventions/global/AGENTS.md +146 -100
  8. package/conventions/global/CLAUDE.md +1 -21
  9. package/conventions/global/GEMINI.md +8 -22
  10. package/conventions/global/project_rules.md +9 -0
  11. package/conventions/templates/backend-service/AGENTS.md +30 -81
  12. package/conventions/templates/backend-service/GEMINI.md +3 -3
  13. package/conventions/templates/backend-service/project_rules.md +16 -0
  14. package/conventions/templates/cli/AGENTS.md +31 -58
  15. package/conventions/templates/cli/CLAUDE.md +3 -5
  16. package/conventions/templates/cli/GEMINI.md +3 -3
  17. package/conventions/templates/cli/project_rules.md +16 -0
  18. package/conventions/templates/frontend-only/AGENTS.md +29 -64
  19. package/conventions/templates/frontend-only/GEMINI.md +3 -3
  20. package/conventions/templates/frontend-only/project_rules.md +14 -0
  21. package/conventions/templates/fullstack/AGENTS.md +31 -79
  22. package/conventions/templates/fullstack/CLAUDE.md +1 -1
  23. package/conventions/templates/fullstack/GEMINI.md +3 -3
  24. package/conventions/templates/fullstack/project_rules.md +15 -0
  25. package/lib/README.md +42 -0
  26. package/lib/__pycache__/github_sync.cpython-314.pyc +0 -0
  27. package/lib/__pycache__/loop-fmt.cpython-314.pyc +0 -0
  28. package/lib/__pycache__/loop_result_eval.cpython-314.pyc +0 -0
  29. package/lib/__pycache__/loop_unstick.cpython-314.pyc +0 -0
  30. package/lib/__pycache__/model_prices.cpython-314.pyc +0 -0
  31. package/lib/__pycache__/prices_fetcher.cpython-314.pyc +0 -0
  32. package/lib/__pycache__/roll-home.cpython-314.pyc +0 -0
  33. package/lib/__pycache__/roll-loop-status.cpython-314.pyc +0 -0
  34. package/lib/__pycache__/roll_git.cpython-314.pyc +0 -0
  35. package/lib/__pycache__/roll_render.cpython-314.pyc +0 -0
  36. package/lib/__pycache__/slides-render.cpython-314.pyc +0 -0
  37. package/lib/agent_usage/README.md +49 -0
  38. package/lib/agent_usage/__init__.py +108 -0
  39. package/lib/agent_usage/__pycache__/__init__.cpython-314.pyc +0 -0
  40. package/lib/agent_usage/__pycache__/gemini.cpython-314.pyc +0 -0
  41. package/lib/agent_usage/__pycache__/kimi.cpython-314.pyc +0 -0
  42. package/lib/agent_usage/__pycache__/openai.cpython-314.pyc +0 -0
  43. package/lib/agent_usage/__pycache__/pi.cpython-314.pyc +0 -0
  44. package/lib/agent_usage/__pycache__/pi_emit.cpython-314.pyc +0 -0
  45. package/lib/agent_usage/__pycache__/qwen.cpython-314.pyc +0 -0
  46. package/lib/agent_usage/gemini.py +127 -0
  47. package/lib/agent_usage/kimi.py +278 -0
  48. package/lib/agent_usage/kimi_emit.py +123 -0
  49. package/lib/agent_usage/openai.py +126 -0
  50. package/lib/agent_usage/pi.py +200 -0
  51. package/lib/agent_usage/pi_emit.py +135 -0
  52. package/lib/agent_usage/qwen.py +128 -0
  53. package/lib/backfill-pi-usage.py +243 -0
  54. package/lib/changelog_audit.py +155 -0
  55. package/lib/changelog_generate.py +263 -0
  56. package/lib/context_feed_budget.sh +194 -0
  57. package/lib/github_sync.py +876 -0
  58. package/lib/i18n/README.md +54 -0
  59. package/lib/i18n/agent.sh +75 -0
  60. package/lib/i18n/alert.sh +20 -0
  61. package/lib/i18n/backlog.sh +96 -0
  62. package/lib/i18n/brief.sh +5 -0
  63. package/lib/i18n/changelog.sh +5 -0
  64. package/lib/i18n/ci.sh +15 -0
  65. package/lib/i18n/debug.sh +0 -0
  66. package/lib/i18n/doctor.sh +44 -0
  67. package/lib/i18n/dream.sh +0 -0
  68. package/lib/i18n/init.sh +91 -0
  69. package/lib/i18n/lang.sh +10 -0
  70. package/lib/i18n/loop.sh +140 -0
  71. package/lib/i18n/migrate.sh +74 -0
  72. package/lib/i18n/offboard.sh +31 -0
  73. package/lib/i18n/onboard.sh +0 -0
  74. package/lib/i18n/peer.sh +41 -0
  75. package/lib/i18n/peer_help.sh +25 -0
  76. package/lib/i18n/peer_reset.sh +7 -0
  77. package/lib/i18n/peer_status.sh +5 -0
  78. package/lib/i18n/prices.sh +3 -0
  79. package/lib/i18n/prices_refresh.sh +17 -0
  80. package/lib/i18n/prices_show.sh +7 -0
  81. package/lib/i18n/propose.sh +0 -0
  82. package/lib/i18n/release.sh +0 -0
  83. package/lib/i18n/research.sh +0 -0
  84. package/lib/i18n/review_pr.sh +0 -0
  85. package/lib/i18n/sentinel.sh +0 -0
  86. package/lib/i18n/setup.sh +3 -0
  87. package/lib/i18n/shared.sh +157 -0
  88. package/lib/i18n/skills/roll-brief.sh +47 -0
  89. package/lib/i18n/skills/roll-build.sh +97 -0
  90. package/lib/i18n/skills/roll-design.sh +18 -0
  91. package/lib/i18n/skills/roll-fix.sh +53 -0
  92. package/lib/i18n/skills/roll-loop.sh +28 -0
  93. package/lib/i18n/skills/roll-onboard.sh +33 -0
  94. package/lib/i18n/skills_catalog.sh +30 -0
  95. package/lib/i18n/slides.sh +3 -0
  96. package/lib/i18n/slides_build.sh +38 -0
  97. package/lib/i18n/slides_delete.sh +19 -0
  98. package/lib/i18n/slides_list.sh +14 -0
  99. package/lib/i18n/slides_logs.sh +12 -0
  100. package/lib/i18n/slides_new.sh +15 -0
  101. package/lib/i18n/slides_preview.sh +14 -0
  102. package/lib/i18n/slides_templates.sh +7 -0
  103. package/lib/i18n/status.sh +21 -0
  104. package/lib/i18n/update.sh +24 -0
  105. package/lib/i18n.sh +211 -0
  106. package/lib/loop-exit-summary.py +393 -0
  107. package/lib/loop-fmt.py +589 -0
  108. package/lib/loop_pick_agent.py +316 -0
  109. package/lib/loop_result_eval.py +469 -0
  110. package/lib/loop_unstick.py +180 -0
  111. package/lib/model_prices.py +186 -0
  112. package/lib/prices/README.md +35 -0
  113. package/lib/prices/snapshot-2026-05-22.json +22 -0
  114. package/lib/prices/snapshot-2026-05-23-deepseek.json +15 -0
  115. package/lib/prices/snapshot-2026-05-23-kimi.json +14 -0
  116. package/lib/prices_fetcher.py +285 -0
  117. package/lib/roll-backlog.py +225 -0
  118. package/lib/roll-brief.py +286 -0
  119. package/lib/roll-help.py +158 -0
  120. package/lib/roll-home.py +556 -0
  121. package/lib/roll-init.py +156 -0
  122. package/lib/roll-loop-status.py +1683 -0
  123. package/lib/roll-loop-story.py +191 -0
  124. package/lib/roll-onboard-render.py +378 -0
  125. package/lib/roll-peer.py +252 -0
  126. package/lib/roll-plan-validate.py +386 -0
  127. package/lib/roll-setup.py +102 -0
  128. package/lib/roll-status.py +367 -0
  129. package/lib/roll_git.py +41 -0
  130. package/lib/roll_render.py +414 -0
  131. package/lib/slides/components/README.md +123 -0
  132. package/lib/slides/components/cards-2.html +9 -0
  133. package/lib/slides/components/cards-3.html +9 -0
  134. package/lib/slides/components/cards-4.html +9 -0
  135. package/lib/slides/components/compare.html +22 -0
  136. package/lib/slides/components/highlight.html +9 -0
  137. package/lib/slides/components/pipeline.html +12 -0
  138. package/lib/slides/components/plain.html +7 -0
  139. package/lib/slides/components/quote.html +4 -0
  140. package/lib/slides/components/timeline.html +9 -0
  141. package/lib/slides/templates/introduction-v3.html +571 -0
  142. package/lib/slides/templates/pitch.html +0 -0
  143. package/lib/slides-render.py +778 -0
  144. package/lib/slides-validate.py +357 -0
  145. package/lib/test_quality_gate.py +143 -0
  146. package/package.json +8 -7
  147. package/skills/roll-.changelog/SKILL.md +406 -33
  148. package/skills/roll-.clarify/SKILL.md +5 -2
  149. package/skills/roll-.dream/SKILL.md +374 -0
  150. package/skills/roll-.echo/SKILL.md +5 -2
  151. package/skills/roll-.qa/SKILL.md +57 -3
  152. package/skills/roll-.review/SKILL.md +42 -3
  153. package/skills/roll-brief/SKILL.md +209 -0
  154. package/skills/roll-build/SKILL.md +308 -63
  155. package/skills/roll-debug/SKILL.md +341 -162
  156. package/skills/roll-debug/injectable-bb.js +263 -0
  157. package/skills/roll-deck/SKILL.md +296 -0
  158. package/skills/roll-design/ENGINEERING_CHECKLIST.md +1 -1
  159. package/skills/roll-design/SKILL.md +727 -94
  160. package/skills/roll-doc/SKILL.md +595 -0
  161. package/skills/roll-doctor/SKILL.md +192 -0
  162. package/skills/roll-fix/SKILL.md +149 -32
  163. package/skills/{roll-jot → roll-idea}/SKILL.md +18 -10
  164. package/skills/roll-loop/SKILL.md +578 -0
  165. package/skills/roll-notes/SKILL.md +103 -0
  166. package/skills/roll-onboard/SKILL.md +234 -0
  167. package/skills/roll-peer/SKILL.md +336 -0
  168. package/skills/roll-propose/SKILL.md +157 -0
  169. package/skills/roll-review-pr/SKILL.md +58 -0
  170. package/skills/roll-sentinel/SKILL.md +11 -2
  171. package/skills/roll-spar/SKILL.md +8 -6
  172. package/template/.github/workflows/ci.yml +5 -2
  173. package/template/AGENTS.md +20 -74
  174. package/skills/roll-research/SKILL.md +0 -307
  175. package/skills/roll-research/references/schema.json +0 -162
  176. package/skills/roll-research/scripts/md_to_pdf.py +0 -289
  177. package/tools/roll-fetch/SKILL.md +0 -182
  178. package/tools/roll-fetch/package.json +0 -15
  179. package/tools/roll-fetch/smart-web-fetch.js +0 -558
  180. package/tools/roll-probe/SKILL.md +0 -84
  181. /package/template/{BACKLOG.md → .roll/backlog.md} +0 -0
@@ -7,9 +7,25 @@
7
7
  sync_claude: ~/.claude/CLAUDE.md
8
8
  sync_kimi: ~/.kimi/AGENTS.md
9
9
  sync_codex: ~/.codex/AGENTS.md
10
- sync_gemini: ~/.gemini/GEMINI.md
10
+ sync_agy: ~/.gemini/GEMINI.md # Antigravity (agy) reuses the legacy ~/.gemini/ path
11
11
 
12
12
  # User preferences
13
13
  default_language: zh
14
14
  default_project_type: fullstack
15
15
  editor: ${EDITOR:-vim}
16
+
17
+ # --- Advanced ---
18
+ # Cross-machine loop record sync (optional).
19
+ # Set to a private git remote URL to share cycle history across machines.
20
+ # Each machine writes its own events file — no merge conflicts.
21
+ # Private repo strongly recommended: cycle records contain prompt text,
22
+ # file paths, and other potentially sensitive information.
23
+ #
24
+ # roll_records_remote: "git@github.com:you/roll-loop-records.git"
25
+
26
+ # Remote monitoring (optional) — US-OBS-014.
27
+ # Local checkout of your roll-meta repo. When set, each loop cycle end
28
+ # auto-pushes a status snapshot via ops/push-loop-status.sh so the
29
+ # remote-watch prompt always sees fresh data (no manual cron needed).
30
+ # Path supports ~ expansion; a missing path logs one WARNING and is skipped.
31
+ # roll_meta_dir: ~/projects/roll-meta
@@ -1,100 +1,146 @@
1
- # Global Agent Conventions — Sean Yao
2
-
3
- > Master conventions file. All AI coding agents follow these principles.
4
- > Tool-specific files (CLAUDE.md, GEMINI.md, .cursor-rules) extend this document.
5
-
6
- ## Communication
7
-
8
- - Respond in the language I write in. Chinese message → Chinese response. English → English.
9
- - Code, commit messages, variable names, comments: always English.
10
- - Error messages in API responses: English.
11
- - UI-facing text: Chinese (internal tool for Chinese-speaking team).
12
- - Be concise. Don't summarize what you just did I can read the diff.
13
- - Don't ask for confirmation on routine actions. Just do it and show the result.
14
- - If something is ambiguous, make a reasonable judgment call. Only ask when the choice has real consequences.
15
- - Use plain language. No academic jargon or pretentious framing.
16
- - **Roll workflow milestones may be narrated.** It's fine to report high-level progress such as running baseline, sketching a design, completing an Action, passing a Verification Gate, or finishing TCR (Green/Commit or Red/Revert).
17
- - **Implementation details are invisible.** Do not include code diffs, file paths, line numbers, function names, variable names, test scripts, model parameters, or raw git output in conversational responses.
18
- - **Strategic reasoning is okay; tactical code-walking is not.** You may explain *why* a design choice was made at the product/business level. Do not narrate step-by-step code modifications or internal debugging monologues.
19
- - **Report in user-centric outcomes.** After making changes, summarize what improved for the user or product in 1–2 sentences.
20
- - **No code dumps unless explicitly asked.** Never paste code snippets, stack traces, or technical speculations into the chat.
21
- - **Business context over technical mechanics.** When explaining a bug or fix, lead with the user-visible effect. Root causes, if mentioned at all, belong in a single trailing sentence.
22
-
23
- ## Code Style
24
-
25
- - TypeScript strict mode. No `any` unless absolutely unavoidable.
26
- - Functional components with hooks. No class components.
27
- - Prefer `const` over `let`. Never `var`.
28
- - Early returns over nested conditionals.
29
- - Name things clearly no abbreviations except well-known ones (e.g., `id`, `url`, `api`).
30
- - Keep functions short and single-purpose. If it needs a comment to explain, it's too complex.
31
- - Don't add comments unless the logic is genuinely non-obvious.
32
- - Don't add docstrings, JSDoc, or type annotations to code you didn't change.
33
-
34
- ## Git
35
-
36
- - Conventional commit format: `feat:`, `fix:`, `chore:`, `docs:`, `refactor:`, `test:`
37
- - Write in English, concise, imperative mood.
38
- - Never force push to main.
39
- - Never skip hooks (`--no-verify`).
40
- - Never commit `.env`, credentials, or secrets.
41
-
42
- ## Behavior
43
-
44
- - Do not refactor files unrelated to the current task.
45
- - Do not add features, refactoring, or "improvements" not requested.
46
- - Always ask before making structural changes (directory reorganization, architecture changes).
47
- - Don't wrap simple things in abstractions. Three similar lines > a premature helper.
48
- - Don't add error handling for impossible scenarios. Trust the framework.
49
- - Delete unused things completely no `// removed` comments, no backward-compat shims.
50
- - Don't create README.md or documentation files unless asked.
51
-
52
- ## Testing
53
-
54
- - All business logic must have unit tests (coverage >80%).
55
- - All API endpoints must have integration tests no DB mocks.
56
- - Critical user flows must have E2E tests (Playwright).
57
- - New architecture introductions (State/Cache/EventBus) must have data flow integration tests.
58
- - Run existing tests before pushing to verify no regressions.
59
-
60
- ## Engineering Common Sense
61
-
62
- Non-negotiable requirements for all code changes. Violating these is a bug:
63
-
64
- - **Idempotency**: Same operation N times = same result. Test by running 3 times.
65
- - **Cross-module contract**: Shared IDs, formats, algorithms must be identical across modules.
66
- - **Data flow integrity**: Producer Storage Consumer chain must be complete and tested.
67
- - **Atomicity**: Operations complete fully or not at all. Partial failure → rollback.
68
- - **Input validation**: All external input (API, user, file) must be validated.
69
- - **Graceful degradation**: Dependency fails limited functionality, not crash.
70
- - **Observability**: User must see progress, state, and errors.
71
- - **Concurrency safety**: Shared resources under multi-thread/multi-process access must be safe.
72
-
73
- ## Roll Workflow (When Project Has It)
74
-
75
- When a project has Roll workflow configured:
76
-
77
- ### Workspace Structure
78
-
79
- - `BACKLOG.md` = index table, one-line summary per story only.
80
- - `docs/features/<feature>.md` = US details (AC, Files, Dependencies).
81
- - `docs/features/<feature>-plan.md` = architecture design doc (optional).
82
- - Never write project docs to `~/.kimi/` or any global config directory.
83
-
84
- ### Development Discipline
85
-
86
- - **TCR mandatory**: All code changes follow Test → Green = Commit / Red = Revert. No WIP commits.
87
- - **Action granularity**: Each Action independently deployable, completable in 2–5 min. No placeholders (no TBD/TODO/pending).
88
- - **Verification Gate**: Before marking done, provide fresh evidence (test output, screenshot, curl). "I confirmed it works" is not evidence.
89
- - **Complete delivery**: push to GitHub + CI passes + deployed online. Local-only done is not done.
90
-
91
- ### Skill Selection
92
-
93
- ```
94
- Uncertain approach? → $roll-design
95
- Want to ship something? → $roll-build (handles US-XXX, FIX-XXX, or vague ideas)
96
- Single bug fix? → $roll-fix
97
- High-risk logic? → $roll-spar
98
- Page/production issue? → $roll-debug
99
- Initialize new project? → roll init (CLI command, not a skill)
100
- ```
1
+ # Agent Conventions
2
+
3
+ > Baseline for AI-agent-friendly projects. Extend with project-specific rules.
4
+
5
+ ## 1. Communication
6
+ - User's language. Code/Git/Comments: English. UI: Chinese.
7
+ - Concise. No summaries/code-walking. Implementation invisible.
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
+ - **Voice**: Natural, colleague-like tone — neither robotic ("Executing…") nor over-enthusiastic ("Great!"). "Done — here's what changed." instead of "Task completed successfully." Consistent warmth for success and failure alike.
13
+ - **Bilingual output**: EN + ZH on separate lines, never inline.
14
+ ```
15
+ Processing...
16
+ 处理中...
17
+ ```
18
+ Not: `Processing... 处理中...`
19
+
20
+ ## 2. Code
21
+ - **TS**: Strict, no `any`. Functional hooks. Early returns.
22
+ - **Git**: No force-push main. No `--no-verify`. No secrets in git.
23
+ - **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.
24
+ - **Behavior**: No unrelated refactoring. No speculative abstractions.
25
+ - **File ops**: Prefer targeted edits over full file rewrites. Verify file exists before modifying.
26
+
27
+ ## 3. Engineering
28
+ - **Idempotency**: Same op N times = same result.
29
+ - **Atomicity**: Complete fully or rollback. No partial state.
30
+ - **Validation**: All external input validated. Fail fast on startup.
31
+ - **Testing**: Unit >80%. E2E for flows. No DB mocks.
32
+
33
+ ## 4. Workflow
34
+ - **Scope Gate**: Only implement what is explicitly listed in the AC. Nothing more.
35
+ - Requests made in conversation are NOT AC — capture with `roll-idea` first.
36
+ - Any new Story/Fix requires design doc + user confirmation before TCR starts.
37
+ - Do not commit without user approval unless explicitly told to auto-commit.
38
+ - **Goal First**: Before any implementation, state verifiable success criteria.
39
+ Transform vague tasks: "add validation" → "write test for invalid input, then make it pass".
40
+ Multi-step work: list steps with verify checkpoints (step → verify: how to check).
41
+ Weak criteria ("make it work") require human clarification before starting.
42
+ - **TCR**: Test -> Green = Commit / Red = Revert. No WIP commits.
43
+ - Before implementing: confirm exact files, test strategy, and commit message
44
+ draft with user. Do not write code until approved.
45
+ - Before claiming completion: verify in the target environment mentioned by
46
+ user (e.g., specific CLI tool, remote server, hardware platform).
47
+ - **Workspace**: `.roll/backlog.md` index. `.roll/features/` for details.
48
+ - **Backlog descriptions** (US, FIX, REFACTOR, IDEA, PROPOSAL): one sentence in plain language.
49
+ Say what changed and why it matters not how it works internally.
50
+ No file paths, function names, parameter lists, or architecture jargon.
51
+ `depends-on:` and `manual-only:` functional tags are allowed; `Domain:` annotation tags are not.
52
+ Technical details and AC go in `.roll/features/`.
53
+ A well-written BACKLOG description can be used directly as a CHANGELOG entry.
54
+ - **Convention layering**: project-level convention files extend the global SOT — see §9 below.
55
+ - **Done**: Push + CI passes + deployed. Local-only is not done.
56
+ - **Post-push verification** (universal applies to any push to main, regardless of which
57
+ skill drove the work):
58
+ - After every push, wait for the triggered CI run and verify status (`gh run watch`
59
+ or equivalent). Do not move on, switch tasks, or claim completion until CI is green.
60
+ - Before pushing any new code commit, verify the **previous** code-changing push's CI
61
+ is green. Never stack new code commits on top of a red CI (this is the failure
62
+ mode FIX-026 / `_loop_precheck_ci` exists to prevent for the loop humans need
63
+ the same discipline). Every commit now triggers CI (US-POS-006 removed the
64
+ `paths-ignore` allow-list), so doc-only commits run CI too; treat their result
65
+ the same way as any other push.
66
+ - If CI is red, the next action is **fix or revert**, not "queue something else".
67
+ - **Commit message format**:
68
+ - Format: `<type>: <description>` (Git Hook may auto-prepend type prefix)
69
+ - Types: `Story N`, `Fix`, `Refactor`, `Docs`, `Chore`
70
+ - TCR micro-commits use `tcr:` prefix instead
71
+
72
+ ## 5. Refactoring & Renames
73
+
74
+ Project-wide renames require systematic checking. Never assume find/replace
75
+ is sufficient. Execute in order:
76
+
77
+ 1. **Code references** — imports, function names, string literals
78
+ 2. **Documentation** — README, methodology, API docs
79
+ 3. **Config files** YAML frontmatter, package names, manifests
80
+ 4. **Symlinks** verify all resolve after rename
81
+ 5. **Installer scripts** update paths and references
82
+ 6. **Shell environment** remind user to reload or restart sessions
83
+
84
+ Confirm each phase clean before proceeding to the next.
85
+
86
+ ## 6. Configuration & External Services
87
+ - **Config file editing** (YAML/TOML/JSON with schema):
88
+ 1. Find official documentation or a verified working example first
89
+ 2. Do not guess syntax
90
+ 3. If no docs found after 2 searches, ask user for a reference config
91
+ 4. Maximum 2 syntax attempts before escalating to research mode
92
+ - **External services** (npm publishing, proxy, auth-dependent deploy):
93
+ - Stop after 2 failed attempts and ask user for preferred fallback
94
+ - Do not continue iterating on auth/proxy debugging without explicit direction
95
+ - If OIDC/token issues persist, immediately fallback to manual with explanation
96
+
97
+ ## 7. Frontend Default Stack
98
+ - React + shadcn/ui + Tailwind CSS is the default.
99
+ - Use shadcn/ui components first. Custom components only when shadcn doesn't cover it.
100
+ - `components/ui/` is shadcn-generated — never edit manually.
101
+ - Tailwind utility classes only. No inline styles, no CSS modules.
102
+ - Icons: Lucide React.
103
+
104
+ ## 8. Where to Look
105
+ - **Domain model**: `.roll/domain/context-map.md` — Bounded Contexts and relationships
106
+ - **Story details**: `.roll/features/` — AC, implementation specs, dependencies
107
+ - **Design decisions**: `.roll/domain/` — DDD models, architecture records
108
+ - When `.roll/domain/` or `.roll/features/` don't exist yet, run `$roll-doc` to bootstrap.
109
+
110
+ ## 9. Convention Architecture
111
+
112
+ Roll conventions form a two-layer hierarchy. The **global** layer is the single
113
+ source of truth for **cross-project rules** — rules that apply regardless of
114
+ stack, language, or domain (e.g., BACKLOG row format, identity, TCR rhythm,
115
+ commit message format, scope discipline). The **project** layer carries only
116
+ **project-specific** rules — stack, structure, build commands, domain
117
+ conventions, deploy targets.
118
+
119
+ **The contract:**
120
+
121
+ 1. Every project-level convention file **must declare it extends the global
122
+ counterpart** via a one-line foundation note at the top (e.g., "Extends
123
+ `~/.<agent>/AGENTS.md`" or "Extends AGENTS.md in this directory").
124
+ 2. Project-level files **never duplicate or re-state** cross-project rules.
125
+ When you find yourself wanting to copy a rule down, add a pointer instead.
126
+ 3. Cross-project rules go in `conventions/global/`. Project-specific rules go
127
+ in `conventions/templates/<type>/`. Anything that applies regardless of
128
+ stack belongs upstairs.
129
+
130
+ **Layered file pairs** — each global ↔ project pair must follow the contract:
131
+
132
+ | Global SOT | Project layer | Audience |
133
+ |---|---|---|
134
+ | `conventions/global/AGENTS.md` | `conventions/templates/<type>/AGENTS.md` | All agents |
135
+ | `conventions/global/CLAUDE.md` | `conventions/templates/<type>/CLAUDE.md` | Claude Code |
136
+ | `conventions/global/GEMINI.md` | `conventions/templates/<type>/GEMINI.md` | Antigravity (agy) — reads `~/.gemini/GEMINI.md` natively |
137
+ | `conventions/global/project_rules.md` | `conventions/templates/<type>/project_rules.md` | Trae IDE |
138
+
139
+ The CLAUDE / GEMINI / project_rules global files themselves declare they
140
+ extend this AGENTS.md, so this section's rules apply transitively to all
141
+ four file families.
142
+
143
+ **Why it matters**: copies drift, pointers don't. When a rule must change, it
144
+ changes in one place and propagates; if it's duplicated, half the copies get
145
+ updated and the others silently lag — which is the failure mode that produced
146
+ this section in the first place.
@@ -3,30 +3,10 @@
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
- - When a project has Roll skills, use them (`$roll-design`, `$roll-story`, etc.).
8
+ - When a project has Roll skills, use them (`$roll-design`, `$roll-build`, `$roll-fix`, etc.).
21
9
  - Use plan mode for complex multi-step tasks before executing.
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.
@@ -1,28 +1,14 @@
1
- # Global Preferences — Gemini CLI
1
+ # Global Preferences — Antigravity (agy)
2
2
 
3
3
  > Extends AGENTS.md in this directory — read that first for shared conventions.
4
- > This file adds Gemini CLI-specific configuration only.
4
+ > This file adds Antigravity-specific configuration only.
5
+ >
6
+ > File is named `GEMINI.md` because agy reads `~/.gemini/GEMINI.md` natively
7
+ > (it reuses the legacy Gemini CLI config dir). The filename is the canonical
8
+ > agy-side filename; the content here is for agy.
5
9
 
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
- ## Gemini-Specific
10
+ ## Antigravity-Specific
18
11
 
19
12
  - When running shell commands, prefer the most specific tool available.
20
- - For file operations, verify the file exists before modifying.
21
13
  - 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.
14
+ - Invoke interactively with `agy -i "<prompt>"`; non-interactive with `agy -p "<prompt>"`.
@@ -0,0 +1,9 @@
1
+ # Global Preferences — Trae IDE
2
+
3
+ > Extends AGENTS.md in this directory — read that first for shared conventions.
4
+ > This file adds Trae IDE-specific configuration only.
5
+
6
+ ## Trae-Specific
7
+
8
+ - When a project has Roll workflow, follow the AGENTS.md conventions and use Roll skills.
9
+ - Use Solo mode for complex multi-step tasks.
@@ -1,88 +1,37 @@
1
1
  # Project Conventions — Backend Service
2
2
 
3
- > Project-type-specific conventions reference material for skills.
4
- > **Note: Reference Template** — used by skills to infer project conventions. Not selected by users.
5
-
6
- ## API Design
7
-
8
- - RESTful API with consistent URL structure: `/api/{resource}/{id}`.
9
- - For internal microservices, gRPC is acceptable.
10
- - Structured error responses: `{ error: string, code: string, details?: object }`.
11
- - Health check endpoint: `GET /api/health` returning `{ status: "ok", version: string }`.
12
- - API versioning via URL prefix (`/api/v1/`) when breaking changes are needed.
13
-
14
- ## Configuration
15
-
16
- - Environment config via `.env`. Never hardcode secrets.
17
- - Use `.env.example` as the template with all required variables documented.
18
- - Validate all env vars at startup — fail fast if missing.
19
- - Separate configs for development, staging, production.
20
-
21
- ## Logging
22
-
23
- - Structured JSON logging (e.g., pino, winston with JSON transport).
24
- - Log levels: `error`, `warn`, `info`, `debug`. Default to `info` in production.
25
- - Include correlation IDs for request tracing.
26
- - Never log secrets, tokens, or PII.
27
-
28
- ## Error Handling
29
-
30
- - Domain errors: typed error classes with error codes.
31
- - HTTP errors: map domain errors to appropriate status codes.
32
- - Unhandled errors: catch-all middleware, log full stack, return 500 with safe message.
33
- - Validation errors: 400 with detailed field-level error messages.
34
-
35
- ## Project Structure
36
-
3
+ > Reference for skills to infer backend project conventions.
4
+ >
5
+ > **Foundation**: extends the shared rules in `~/.<agent>/AGENTS.md`
6
+ > (installed by `roll setup`). For BACKLOG row format, identity, TCR
7
+ > rhythm, and other cross-project rules, see that file's §4. Only
8
+ > project-specific stack / structure / domain rules live below.
9
+
10
+ ## 1. Design
11
+ - **API**: RESTful `/api/{res}/{id}`. Structured JSON errors.
12
+ - **Config**: `.env` (validate at start). Flags > Env > File.
13
+ - **Logging**: Structured JSON (pino/winston). No secrets/PII.
14
+
15
+ ## 2. Architecture
16
+ - **DDD**: Organize by business domain, not tech layer.
17
+ - **Clean**: Routes (thin) -> Services (logic) -> Models (data).
18
+ - **Database**: Migrations mandatory. Transactions for multi-table.
19
+
20
+ ## 3. Structure
37
21
  ```
38
22
  src/
39
- ├── routes/ # HTTP route handlers (thin — delegate to services)
40
- ├── services/ # business logic (pure functions where possible)
41
- ├── models/ # data models, ORM entities, schemas
42
- ├── middleware/ # auth, logging, error handling, validation
43
- ├── utils/ # shared utilities
44
- ├── types/ # TypeScript type definitions
45
- ├── config/ # environment config, constants
46
- └── index.ts # entry point, server bootstrap
47
-
48
- tests/
49
- ├── unit/ # service/model unit tests
50
- ├── integration/ # API endpoint tests (supertest)
51
- └── regression/ # Sentinel regression
23
+ ├── routes/ # thin handlers
24
+ ├── services/ # business logic
25
+ ├── models/ # schemas/entities
26
+ └── middleware/ # auth/log/error
52
27
  ```
53
28
 
54
- ## Database
55
-
56
- - Migrations managed via a migration tool (Prisma, Drizzle, Knex).
57
- - Never modify production data manually — always through migrations.
58
- - Index frequently queried columns. Monitor slow queries.
59
- - Use transactions for multi-table operations.
60
-
61
- ## Security
62
-
63
- - Input validation on all endpoints (zod, joi, or similar).
64
- - Rate limiting on public endpoints.
65
- - CORS configured explicitly — no wildcard in production.
66
- - Authentication middleware applied at route level, not globally.
67
- - Secrets rotated periodically. Never in git history.
68
-
69
- ## Architecture Constraints
70
-
71
- - **Domain Driven**: organize code by business domain, not technical layer. `src/services/` contains domain logic, not generic utilities.
72
- - **Clean Architecture**: routes (thin) → services (business logic) → models (data) ← infrastructure (DB/external APIs). Routes delegate; they don't contain business logic.
73
- - **Data Schema First**: define types/schemas before writing business logic.
74
- - **API Contract**: typed request/response schemas. API changes must bump version or be backward-compatible.
75
-
76
- ## Development Discipline
77
-
78
- - **TCR mandatory**: All code changes follow Test → Green = Commit / Red = Revert. No WIP commits.
79
- - **Action granularity**: Each Action independently deployable, completable in 2–5 min. No placeholders (no TBD/TODO/pending).
80
- - **Verification Gate**: Before marking done, provide fresh evidence (test output, curl response). "I confirmed it works" is not evidence.
81
- - **Complete delivery**: push to GitHub + CI passes + deployed online. Local-only done is not done.
82
-
83
- ## Workspace Structure
29
+ ## 4. Discipline
30
+ - **TCR**: Mandatory.
31
+ - **Security**: Input validation (zod), Rate limiting, Secrets rotation.
32
+ - **Workspace**: `.roll/backlog.md` + `.roll/features/`.
84
33
 
85
- - `BACKLOG.md` = index table, one-line summary per story only.
86
- - `docs/features/<feature>.md` = US details (AC, Files, Dependencies).
87
- - `docs/features/<feature>-plan.md` = architecture design doc (optional).
88
- - Never write project docs to `~/.kimi/` or any global config directory.
34
+ ## 5. Where to Look
35
+ - **Domain model**: `.roll/domain/context-map.md` Bounded Contexts and relationships
36
+ - **Story details**: `.roll/features/` AC, implementation specs, dependencies
37
+ - **Design decisions**: `.roll/domain/` DDD models, architecture records
@@ -1,6 +1,6 @@
1
- # Project Preferences — Backend Service (Gemini CLI)
1
+ # Project Preferences — Backend Service (Antigravity)
2
2
 
3
- > Extends global GEMINI.md + project AGENTS.md.
3
+ > Extends global GEMINI.md (Antigravity) + project AGENTS.md.
4
4
 
5
5
  ## Stack
6
6
 
@@ -8,7 +8,7 @@
8
8
  - Database: Prisma or Drizzle ORM
9
9
  - Testing: Vitest + Supertest
10
10
 
11
- ## Gemini Notes
11
+ ## Antigravity (agy) Notes
12
12
 
13
13
  - No frontend in this project. API-only service.
14
14
  - Write integration tests that hit real endpoints, not mocked handlers.
@@ -0,0 +1,16 @@
1
+ # Project Preferences — Backend Service (Trae IDE)
2
+
3
+ > Extends global project_rules.md + project AGENTS.md.
4
+
5
+ ## Stack
6
+
7
+ - Node.js / TypeScript / Express or Hono or Fastify
8
+ - Database: Prisma or Drizzle ORM
9
+ - Testing: Vitest + Supertest
10
+
11
+ ## Trae Notes
12
+
13
+ - No frontend in this project. API-only service.
14
+ - Write integration tests that hit real endpoints, not mocked handlers.
15
+ - Run `npm run build && npm run test` before pushing.
16
+ - Follow the project AGENTS.md for architecture constraints and Roll workflow.
@@ -1,66 +1,39 @@
1
1
  # Project Conventions — CLI Tool
2
2
 
3
- > Project-type-specific conventions reference material for skills.
4
- > **Note: Reference Template** — used by skills to infer project conventions. Not selected by users.
5
-
6
- ## Design Principles
7
-
8
- - Lightweight. No server, no frontend, no heavy frameworks.
9
- - Clear command structure: `tool <command> [options] [args]`.
10
- - Helpful error messages with actionable suggestions.
11
- - Consistent exit codes: 0 = success, 1 = user error, 2 = system error.
12
- - Support `--help` and `--version` on every command.
13
- - Respect `NO_COLOR` env var for output formatting.
14
-
15
- ## Architecture
16
-
17
- - Single entry point dispatching to command handlers.
18
- - Each command in its own file — easy to find, easy to test.
19
- - Config loading: CLI flags > environment variables > config file > defaults.
20
- - Use a CLI framework (commander, yargs, or citty) for argument parsing.
21
-
22
- ## Output
23
-
24
- - Default to human-readable output. Support `--json` for machine-readable.
25
- - Progress indicators for long operations (ora, cli-progress).
26
- - Errors to stderr, results to stdout.
27
- - Quiet mode (`--quiet` or `-q`) suppresses non-essential output.
28
-
29
- ## Project Structure
30
-
3
+ > Reference for skills to infer CLI project conventions.
4
+ >
5
+ > **Foundation**: extends the shared rules in `~/.<agent>/AGENTS.md`
6
+ > (installed by `roll setup`). For BACKLOG row format, identity, TCR
7
+ > rhythm, and other cross-project rules, see that file's §4. Only
8
+ > project-specific stack / structure / domain rules live below.
9
+
10
+ ## 1. Principles
11
+ - **Lightweight**: No server/frontend.
12
+ - **Commands**: `tool <cmd> [opts]`. One file per cmd in `src/commands/`.
13
+ - **Exit Codes**: 0 success, 1 user error, 2 system error.
14
+
15
+ ## 2. Architecture
16
+ - **Entry**: `src/index.ts` bootstrap.
17
+ - **Config**: Flags > Env > File > Defaults.
18
+ - **Output**: Human-friendly default, `--json` support. Errors to stderr.
19
+
20
+ ## 3. Structure
31
21
  ```
32
22
  src/
33
- ├── index.ts # entry point, CLI bootstrap
34
- ├── commands/ # one file per command
35
- │ ├── init.ts
36
- │ ├── build.ts
37
- │ └── ...
38
- ├── utils/ # shared utilities
39
- ├── types/ # type definitions
40
- └── config.ts # config loading logic
41
-
23
+ ├── index.ts # bootstrap
24
+ ├── commands/ # handlers
25
+ └── config.ts # logic
42
26
  tests/
43
- ├── unit/ # command logic tests
44
- └── integration/ # full CLI invocation tests (execa)
27
+ ├── unit/ # logic
28
+ └── integration/ # execa
45
29
  ```
46
30
 
47
- ## Distribution
48
-
49
- - Compile to single executable or publish to npm.
50
- - Include `bin` field in `package.json`.
51
- - Test installation flow: `npm install -g` should work cleanly.
52
- - Include a man page or `--help` output that covers all commands.
53
-
54
- ## Development Discipline
55
-
56
- - **TCR mandatory**: All code changes follow Test → Green = Commit / Red = Revert. No WIP commits.
57
- - **Action granularity**: Each Action independently deployable, completable in 2–5 min. No placeholders (no TBD/TODO/pending).
58
- - **Verification Gate**: Before marking done, run the actual command and paste the output. "I confirmed it works" is not evidence.
59
- - **Complete delivery**: push to GitHub + CI passes + published/deployed. Local-only done is not done.
60
-
61
- ## Workspace Structure
31
+ ## 4. Discipline
32
+ - **TCR**: Mandatory.
33
+ - **Distribution**: `bin` in `package.json`, test `npm i -g`.
34
+ - **Workspace**: `.roll/backlog.md` + `.roll/features/`.
62
35
 
63
- - `BACKLOG.md` = index table, one-line summary per story only.
64
- - `docs/features/<feature>.md` = US details (AC, Files, Dependencies).
65
- - `docs/features/<feature>-plan.md` = architecture design doc (optional).
66
- - Never write project docs to `~/.kimi/` or any global config directory.
36
+ ## 5. Where to Look
37
+ - **Domain model**: `.roll/domain/context-map.md` Bounded Contexts and relationships
38
+ - **Story details**: `.roll/features/` AC, implementation specs, dependencies
39
+ - **Design decisions**: `.roll/domain/` DDD models, architecture records