docs(agents): 新增 Workflow 章节,约定每完成功能点即提交
Some checks failed
CI / check (push) Failing after 5m8s
CI / build (push) Has been skipped

- Agent 自主判断提交时机,验证通过后直接提交,无需等待指令
- 顺带更新 make build 注释,补充 doc 步骤与 make doc/doc-open 命令
This commit is contained in:
xfy 2026-06-26 11:08:55 +08:00
parent 25e01a109b
commit 731547e6df

View File

@ -1,18 +1,27 @@
# AGENTS.md
## Workflow
- **每完成一个功能点立即提交**。Agent 自主判断提交时机——当一个逻辑完整的改动通过验证(编译通过 / 测试通过)后,无需等待用户指令,直接 `git add` + `git commit`
- 提交粒度按"功能点"而非"文件":相关联的多文件改动合并为一个提交,不相关的改动拆成多个提交。
- 提交信息遵循现有风格:`type(scope): 简述`,正文(可选)说明动机与关键改动。常见 type:`feat` / `fix` / `docs` / `refactor` / `chore` / `perf`
- 只在用户明确要求时才 `git push`。提交到本地即可,不主动推送。
## Development Commands
```bash
make dev # tailwindcss watch + dx serve (needs PostgreSQL)
make build # build-editor → highlight-css → tailwindcss → dx build --release
make build # build-editor → highlight-css → tailwindcss → doc → dx build --release
make build-linux # same as build but targets x86_64-unknown-linux-musl
make css # one-shot CSS
make css-watch # watch mode
make test # cargo test + vitest (tiptap-editor + lightbox libs)
make doc # cargo doc (ayu 主题) → 拷贝到 public/doc/,随 build 发布
make doc-open # 同 doc生成后自动用浏览器打开本地预览不拷贝
make clean # cargo clean + rm public/style.css
```
**Build order matters**: `make build` runs `build-editor``highlight-css` (`cargo run --bin generate_highlight_css`) → `tailwindcss --minify``dx build --release`. Do not run `dx build --release` alone.
**Build order matters**: `make build` runs `build-editor``highlight-css` (`cargo run --bin generate_highlight_css`) → `tailwindcss --minify``doc` (`cargo doc` + 拷贝到 `public/doc/`) → `dx build --release`. Do not run `dx build --release` alone.
## Prerequisites