Repository navigation
chore: add AGENTS.md, PR template, and CI workflow #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ## What and why | ||
|
|
||
| <!-- The problem (with evidence) and what this changes. --> | ||
|
|
||
| ## Screenshots | ||
|
|
||
| <!-- Required for any user-visible change (AGENTS.md rules 5–6): capture with `.\scripts\shots.ps1` | ||
| before opening the PR and attach with `gh pr create --attach 'file.png#alt text'`, before/after when visual. | ||
| If nothing a user sees changes, replace this comment with: No user-visible change. --> | ||
|
|
||
| ## Tests | ||
|
|
||
| <!-- What runs (`cargo test --workspace`, `cargo clippy --workspace --all-targets`), and which test fails on main without this change. --> |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,54 @@ | ||||||||||||
| name: CI | ||||||||||||
|
|
||||||||||||
| on: | ||||||||||||
| pull_request: | ||||||||||||
| push: | ||||||||||||
| branches: [main] | ||||||||||||
|
|
||||||||||||
| concurrency: | ||||||||||||
| group: ci-${{ github.ref }} | ||||||||||||
| cancel-in-progress: true | ||||||||||||
|
|
||||||||||||
| permissions: | ||||||||||||
| contents: read | ||||||||||||
|
|
||||||||||||
| env: | ||||||||||||
| CARGO_TERM_COLOR: always | ||||||||||||
|
|
||||||||||||
| jobs: | ||||||||||||
| fmt: | ||||||||||||
| runs-on: ubuntu-latest | ||||||||||||
|
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The
Suggested change
Prompt for AI agents |
||||||||||||
| steps: | ||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Neither Trace
Prompt for AI agents |
||||||||||||
| - uses: dtolnay/rust-toolchain@stable | ||||||||||||
| with: | ||||||||||||
| components: rustfmt | ||||||||||||
| - run: cargo fmt --check | ||||||||||||
|
|
||||||||||||
| check: | ||||||||||||
| strategy: | ||||||||||||
| fail-fast: false | ||||||||||||
| matrix: | ||||||||||||
| os: [windows-latest, macos-latest] | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Trace
Prompt for AI agents |
||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||
| timeout-minutes: 45 | ||||||||||||
| steps: | ||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||
| - uses: dtolnay/rust-toolchain@stable | ||||||||||||
| with: | ||||||||||||
| components: clippy | ||||||||||||
| - uses: Swatinem/rust-cache@v2 | ||||||||||||
| with: | ||||||||||||
| key: ${{ runner.os }}-cargo | ||||||||||||
| - name: Cache OpenCascade (.occt) | ||||||||||||
| uses: actions/cache@v4 | ||||||||||||
| with: | ||||||||||||
| path: .occt | ||||||||||||
| key: ${{ runner.os }}-occt-8.0.1 | ||||||||||||
|
Comment on lines
+43
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Trace
Prompt for AI agentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Trace
Prompt for AI agents |
||||||||||||
| - name: Install CMake (macOS) | ||||||||||||
| if: runner.os == 'macOS' | ||||||||||||
| run: brew install cmake | ||||||||||||
| - name: Clippy | ||||||||||||
| run: cargo clippy --workspace --all-targets | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Both Trace
Prompt for AI agents |
||||||||||||
| - name: Test | ||||||||||||
| run: cargo test --workspace | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # AGENTS.md | ||
|
|
||
| How to work in this repo (humans and coding agents alike). Mantis: | ||
| agentic hardware IDE in Rust on GPUI. Fork of `GrowlyX/mantis` maintained under `ZOGWORK/mantis` with full Windows support. | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. **Every change goes through a pull request.** Branch from `main`, push, and open the PR against `ZOGWORK/mantis`. Never push to `main` directly. Cut branches with `git checkout --no-track -b <branch> origin/main` and push with `git push -u origin HEAD:refs/heads/<branch>`. | ||
| 2. **Loopy review to 5/5 — Loopy is the only reviewer.** Trigger with a `@loopyreviews-bot review` comment, fix every finding, reply on and resolve each thread, push, and re-trigger. Merge only when the latest Loopy comment says **Confidence 5/5**, its "last reviewed" commit is the PR's **current head commit**, **0 threads are unresolved**, and CI is green. Read the bot's comment itself, not only the `loopy/review` status. If Loopy is down, stop and ask the owner: there is no self-review fallback. | ||
| 3. **Tests, formatting, and lints before pushing.** Run `cargo fmt --check`, `cargo clippy --workspace --all-targets`, and `cargo test --workspace`. A bug fix comes with a test that fails on `main` and passes on the branch. | ||
| 4. **Keep upstream compatibility.** Preserve `#[cfg(target_os = "macos")]` / `#[cfg(unix)]` paths untouched wherever possible and isolate Windows-specific implementations under `#[cfg(target_os = "windows")]`, so `upstream` (`GrowlyX/mantis`) stays easy to sync and our changes can be upstreamed cleanly. | ||
|
|
||
| ## Screenshots and verification | ||
|
|
||
| 5. **UI changes ship with screenshots, captured before the PR opens.** If the diff changes anything a user sees in `mantis-app` (layout, panels, colors, 3D viewport, controls, dialogs), the PR body embeds at least one screenshot of the rendered change inline — before/after when the change is visual. A link out, a screenshot of code, or a promise to demo later does not satisfy this. A PR with no user-visible change writes `"No user-visible change."` in the template's `## Screenshots` section rather than deleting it, so the reviewer sees the claim and can disagree. | ||
| 6. **Capture with `scripts/shots.ps1` (Windows) or `MANTIS_SNAPSHOT` (macOS), never ad-hoc scripts.** It runs `mantis` headless via `MANTIS_SNAPSHOT`, `MANTIS_STATE`, `MANTIS_DO`, and `MANTIS_SIZE`, and writes PNGs **outside the repository** (under `$env:TEMP\mantis-shots`). Attach them with the GitHub CLI: `gh pr create --attach 'file.png#alt text'` or `gh pr comment <n> --attach ...`. Never commit screenshots to the repo. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Rule 6 mandates Trace
Prompt for AI agents |
||
|
|
||
| ## Code conventions | ||
|
|
||
| 7. **Line endings:** LF (`\n`) for Rust/TOML/YAML/Markdown; PowerShell scripts (`.ps1`) may use UTF-8. No spaces in file names. | ||
| 8. **Secrets:** Never commit API keys (`ANTHROPIC_API_KEY`, `EXA_API_KEY`, `MANTIS_STORE_TOKEN`) or `.db` files. | ||
| 9. **Upstream sync:** `origin` is `ZOGWORK/mantis` and `upstream` is `GrowlyX/mantis`. Sync `main` via `git fetch upstream` and PRs, never force-push `main`. | ||
|
|
||
| ## Useful commands | ||
|
|
||
| ```powershell | ||
| cargo test --workspace # run all Rust unit/integration tests | ||
| cargo clippy --workspace --all-targets # lint workspace | ||
| cargo run --release -p mantis-app # launch the GPUI desktop app | ||
| cargo run --release -p mantis-cli -- demo out # build and route reference board | ||
| .\scripts\shots.ps1 # capture PR screenshots outside repo | ||
| .\scripts\bundle.ps1 # build release Windows package | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # CLAUDE.md | ||
|
|
||
| Read and follow [AGENTS.md](AGENTS.md): every change via PR on `ZOGWORK/mantis`, Loopy (the only reviewer) to 5/5 on the head commit, `cargo fmt --check` + `cargo clippy` + `cargo test --workspace`, and screenshots with `scripts/shots.ps1` (or `MANTIS_SNAPSHOT`) for anything user-visible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state· Main-branch CI cancelled by next mergecancel-in-progress: trueis unconditional and the group isgithub.ref, so forpushevents onmaina second merge landing while the first merge's CI is still running (thecheckjob alone allows 45 minutes) cancels the first merge's run. That commit is left with a cancelled rather than green/red status, and its post-merge cache saves never complete for later PRs to restore from. Scope cancellation to pull requests, e.g.cancel-in-progress: ${{ github.event_name == 'pull_request' }}.Trace
.github/workflows/ci.yml:10changedcancel-in-progress: true.github/workflows/ci.yml:5changedpush:.github/workflows/ci.yml:34changedtimeout-minutes: 45Prompt for AI agents