Unverified 提交 ba0de4ee authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Update AGENTS/CONTRIBUTING docs (#2089)

<!-- CURSOR_SUMMARY --> > [!NOTE] > Updates contributor and agent docs for testing, DB migrations, and reviews. > > - Expands `AGENTS.md` with a pointer to `CONTRIBUTING.md` and a new **Testing** section outlining when to use unit vs E2E tests > - In `CONTRIBUTING.md`, clarifies **DB migration** flow: use `npm run db:generate` (remove `db:push`) and how to reset by deleting `userData/sqlite.db` > - Adds a **Code reviews** section noting AI reviewers and local review tooling (`codex`, `claude`) > - Minor cleanup/edits for setup and guidance; no code changes > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 517c8f7a0a4a56487707e8711bfe1b1a4bd95431. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Updated AGENTS.md and CONTRIBUTING.md to clarify testing approach (unit vs E2E), update database migration steps, and document the code review process and local review tools. This helps agents and contributors follow a consistent workflow. <sup>Written for commit 517c8f7a0a4a56487707e8711bfe1b1a4bd95431. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
上级 319d2b77
# Repository Agent Guide
Please read `CONTRIBUTING.md` which includes information for human code contributors. Much of the information is applicable to you as well.
## Project context
- This is an Electron application with a secure IPC boundary.
......@@ -40,3 +42,17 @@ IMPORTANT: Do NOT generate SQL migration files by hand! This is wrong.
- Add tests in the same folder tree when touching renderer components.
Use these guidelines whenever you work within this repository.
## Testing
Our project relies on a combination of unit testing and E2E testing.
### Unit testing
Use unit testing for pure business logic and util functions.
### E2E testing
Use E2E testing when you need to test a complete user flow for a feature.
If you would need to mock a lot of things to unit test a feature, prefer to write an E2E test instead.
# Contributing
Dyad is still a very early-stage project, thus the codebase is rapidly changing.
Before opening a pull request, please open an issue and discuss whether the change makes sense in Dyad. Ensuring a cohesive user experience sometimes means we can't include every possible feature or we need to consider the long-term design of how we want to support a feature area.
- For a high-level overview of how Dyad works, please see the [Architecture Guide](./docs/architecture.md). Understanding the architecture will help ensure your contributions align with the overall design of the project.
......@@ -34,14 +32,16 @@ mkdir userData
md userData
```
**Apply migrations:**
**Generate DB migrations:**
If you change the DB schema (i.e. `src/db/schema.ts`), you will need to generate a DB migration.
```sh
# Generate and apply database migrations
npm run db:generate
npm run db:push
```
> If you want to discard a DB migration, you will likely need to reset your database which you can do by deleting the file in `userData/sqlite.db`.
**Run locally:**
```sh
......@@ -93,3 +93,12 @@ Update snapshots for a test:
```sh
npm run e2e e2e-tests/context_manage.spec.ts -- --update-snapshots
```
## Code reviews
Dyad relies on several AI code reviewers to catch issues. If a comment is irrelevant please leave a brief comment and mark the comment as resolved.
You can also do local code reviews with the following tools:
- Codex CLI - `codex` -> `/review`
- Claude Code CLI - `claude` -> `/review`
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论