@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.
- package/CHANGELOG.md +717 -0
- package/LICENSE +21 -0
- package/README.md +65 -165
- package/bin/dream-test-quality-scan +110 -0
- package/bin/roll +14897 -815
- package/conventions/config.yaml +17 -1
- package/conventions/global/AGENTS.md +146 -100
- package/conventions/global/CLAUDE.md +1 -21
- package/conventions/global/GEMINI.md +8 -22
- package/conventions/global/project_rules.md +9 -0
- package/conventions/templates/backend-service/AGENTS.md +30 -81
- package/conventions/templates/backend-service/GEMINI.md +3 -3
- package/conventions/templates/backend-service/project_rules.md +16 -0
- package/conventions/templates/cli/AGENTS.md +31 -58
- package/conventions/templates/cli/CLAUDE.md +3 -5
- package/conventions/templates/cli/GEMINI.md +3 -3
- package/conventions/templates/cli/project_rules.md +16 -0
- package/conventions/templates/frontend-only/AGENTS.md +29 -64
- package/conventions/templates/frontend-only/GEMINI.md +3 -3
- package/conventions/templates/frontend-only/project_rules.md +14 -0
- package/conventions/templates/fullstack/AGENTS.md +31 -79
- package/conventions/templates/fullstack/CLAUDE.md +1 -1
- package/conventions/templates/fullstack/GEMINI.md +3 -3
- package/conventions/templates/fullstack/project_rules.md +15 -0
- package/lib/README.md +42 -0
- package/lib/__pycache__/github_sync.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop-fmt.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop_result_eval.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop_unstick.cpython-314.pyc +0 -0
- package/lib/__pycache__/model_prices.cpython-314.pyc +0 -0
- package/lib/__pycache__/prices_fetcher.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll-home.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll-loop-status.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll_git.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll_render.cpython-314.pyc +0 -0
- package/lib/__pycache__/slides-render.cpython-314.pyc +0 -0
- package/lib/agent_usage/README.md +49 -0
- package/lib/agent_usage/__init__.py +108 -0
- package/lib/agent_usage/__pycache__/__init__.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/gemini.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/kimi.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/openai.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/pi.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/pi_emit.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/qwen.cpython-314.pyc +0 -0
- package/lib/agent_usage/gemini.py +127 -0
- package/lib/agent_usage/kimi.py +278 -0
- package/lib/agent_usage/kimi_emit.py +123 -0
- package/lib/agent_usage/openai.py +126 -0
- package/lib/agent_usage/pi.py +200 -0
- package/lib/agent_usage/pi_emit.py +135 -0
- package/lib/agent_usage/qwen.py +128 -0
- package/lib/backfill-pi-usage.py +243 -0
- package/lib/changelog_audit.py +155 -0
- package/lib/changelog_generate.py +263 -0
- package/lib/context_feed_budget.sh +194 -0
- package/lib/github_sync.py +876 -0
- package/lib/i18n/README.md +54 -0
- package/lib/i18n/agent.sh +75 -0
- package/lib/i18n/alert.sh +20 -0
- package/lib/i18n/backlog.sh +96 -0
- package/lib/i18n/brief.sh +5 -0
- package/lib/i18n/changelog.sh +5 -0
- package/lib/i18n/ci.sh +15 -0
- package/lib/i18n/debug.sh +0 -0
- package/lib/i18n/doctor.sh +44 -0
- package/lib/i18n/dream.sh +0 -0
- package/lib/i18n/init.sh +91 -0
- package/lib/i18n/lang.sh +10 -0
- package/lib/i18n/loop.sh +140 -0
- package/lib/i18n/migrate.sh +74 -0
- package/lib/i18n/offboard.sh +31 -0
- package/lib/i18n/onboard.sh +0 -0
- package/lib/i18n/peer.sh +41 -0
- package/lib/i18n/peer_help.sh +25 -0
- package/lib/i18n/peer_reset.sh +7 -0
- package/lib/i18n/peer_status.sh +5 -0
- package/lib/i18n/prices.sh +3 -0
- package/lib/i18n/prices_refresh.sh +17 -0
- package/lib/i18n/prices_show.sh +7 -0
- package/lib/i18n/propose.sh +0 -0
- package/lib/i18n/release.sh +0 -0
- package/lib/i18n/research.sh +0 -0
- package/lib/i18n/review_pr.sh +0 -0
- package/lib/i18n/sentinel.sh +0 -0
- package/lib/i18n/setup.sh +3 -0
- package/lib/i18n/shared.sh +157 -0
- package/lib/i18n/skills/roll-brief.sh +47 -0
- package/lib/i18n/skills/roll-build.sh +97 -0
- package/lib/i18n/skills/roll-design.sh +18 -0
- package/lib/i18n/skills/roll-fix.sh +53 -0
- package/lib/i18n/skills/roll-loop.sh +28 -0
- package/lib/i18n/skills/roll-onboard.sh +33 -0
- package/lib/i18n/skills_catalog.sh +30 -0
- package/lib/i18n/slides.sh +3 -0
- package/lib/i18n/slides_build.sh +38 -0
- package/lib/i18n/slides_delete.sh +19 -0
- package/lib/i18n/slides_list.sh +14 -0
- package/lib/i18n/slides_logs.sh +12 -0
- package/lib/i18n/slides_new.sh +15 -0
- package/lib/i18n/slides_preview.sh +14 -0
- package/lib/i18n/slides_templates.sh +7 -0
- package/lib/i18n/status.sh +21 -0
- package/lib/i18n/update.sh +24 -0
- package/lib/i18n.sh +211 -0
- package/lib/loop-exit-summary.py +393 -0
- package/lib/loop-fmt.py +589 -0
- package/lib/loop_pick_agent.py +316 -0
- package/lib/loop_result_eval.py +469 -0
- package/lib/loop_unstick.py +180 -0
- package/lib/model_prices.py +186 -0
- package/lib/prices/README.md +35 -0
- package/lib/prices/snapshot-2026-05-22.json +22 -0
- package/lib/prices/snapshot-2026-05-23-deepseek.json +15 -0
- package/lib/prices/snapshot-2026-05-23-kimi.json +14 -0
- package/lib/prices_fetcher.py +285 -0
- package/lib/roll-backlog.py +225 -0
- package/lib/roll-brief.py +286 -0
- package/lib/roll-help.py +158 -0
- package/lib/roll-home.py +556 -0
- package/lib/roll-init.py +156 -0
- package/lib/roll-loop-status.py +1683 -0
- package/lib/roll-loop-story.py +191 -0
- package/lib/roll-onboard-render.py +378 -0
- package/lib/roll-peer.py +252 -0
- package/lib/roll-plan-validate.py +386 -0
- package/lib/roll-setup.py +102 -0
- package/lib/roll-status.py +367 -0
- package/lib/roll_git.py +41 -0
- package/lib/roll_render.py +414 -0
- package/lib/slides/components/README.md +123 -0
- package/lib/slides/components/cards-2.html +9 -0
- package/lib/slides/components/cards-3.html +9 -0
- package/lib/slides/components/cards-4.html +9 -0
- package/lib/slides/components/compare.html +22 -0
- package/lib/slides/components/highlight.html +9 -0
- package/lib/slides/components/pipeline.html +12 -0
- package/lib/slides/components/plain.html +7 -0
- package/lib/slides/components/quote.html +4 -0
- package/lib/slides/components/timeline.html +9 -0
- package/lib/slides/templates/introduction-v3.html +571 -0
- package/lib/slides/templates/pitch.html +0 -0
- package/lib/slides-render.py +778 -0
- package/lib/slides-validate.py +357 -0
- package/lib/test_quality_gate.py +143 -0
- package/package.json +8 -7
- package/skills/roll-.changelog/SKILL.md +406 -33
- package/skills/roll-.clarify/SKILL.md +5 -2
- package/skills/roll-.dream/SKILL.md +374 -0
- package/skills/roll-.echo/SKILL.md +5 -2
- package/skills/roll-.qa/SKILL.md +57 -3
- package/skills/roll-.review/SKILL.md +42 -3
- package/skills/roll-brief/SKILL.md +209 -0
- package/skills/roll-build/SKILL.md +308 -63
- package/skills/roll-debug/SKILL.md +341 -162
- package/skills/roll-debug/injectable-bb.js +263 -0
- package/skills/roll-deck/SKILL.md +296 -0
- package/skills/roll-design/ENGINEERING_CHECKLIST.md +1 -1
- package/skills/roll-design/SKILL.md +727 -94
- package/skills/roll-doc/SKILL.md +595 -0
- package/skills/roll-doctor/SKILL.md +192 -0
- package/skills/roll-fix/SKILL.md +149 -32
- package/skills/{roll-jot → roll-idea}/SKILL.md +18 -10
- package/skills/roll-loop/SKILL.md +578 -0
- package/skills/roll-notes/SKILL.md +103 -0
- package/skills/roll-onboard/SKILL.md +234 -0
- package/skills/roll-peer/SKILL.md +336 -0
- package/skills/roll-propose/SKILL.md +157 -0
- package/skills/roll-review-pr/SKILL.md +58 -0
- package/skills/roll-sentinel/SKILL.md +11 -2
- package/skills/roll-spar/SKILL.md +8 -6
- package/template/.github/workflows/ci.yml +5 -2
- package/template/AGENTS.md +20 -74
- package/skills/roll-research/SKILL.md +0 -307
- package/skills/roll-research/references/schema.json +0 -162
- package/skills/roll-research/scripts/md_to_pdf.py +0 -289
- package/tools/roll-fetch/SKILL.md +0 -182
- package/tools/roll-fetch/package.json +0 -15
- package/tools/roll-fetch/smart-web-fetch.js +0 -558
- package/tools/roll-probe/SKILL.md +0 -84
- /package/template/{BACKLOG.md → .roll/backlog.md} +0 -0
package/conventions/config.yaml
CHANGED
|
@@ -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
|
-
|
|
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
|
-
#
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
- **
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- **
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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-
|
|
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 —
|
|
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
|
|
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
|
-
##
|
|
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
|
-
-
|
|
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
|
-
>
|
|
4
|
-
>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
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/
|
|
40
|
-
├── services/
|
|
41
|
-
├── models/
|
|
42
|
-
|
|
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
|
-
##
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
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
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
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 (
|
|
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
|
-
##
|
|
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
|
-
>
|
|
4
|
-
>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
## Architecture
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
34
|
-
├── commands/
|
|
35
|
-
|
|
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/
|
|
44
|
-
└── integration/
|
|
27
|
+
├── unit/ # logic
|
|
28
|
+
└── integration/ # execa
|
|
45
29
|
```
|
|
46
30
|
|
|
47
|
-
##
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
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
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
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
|