diff --git a/.opencode/agents/AGENTS.md b/.opencode/agents/AGENTS.md new file mode 100644 index 0000000..23b0ad5 --- /dev/null +++ b/.opencode/agents/AGENTS.md @@ -0,0 +1,49 @@ +# Agent instructions +## Git Commit Style +- Make small, focused commits while working +- Commit changes incrementally to make history easier to follow +- Write clear, concise commit messages describing what changed +- Ask permission before commiting or merging to main branch +- When applicable, write tests before implementation + +# Developer Commands + +```bash +# Unit tests (fast, no database required) +cargo test --lib + +# Integration tests (requires test DB - run setup first) +cargo run -- db setup --env test +cargo test --tests + +# Single test file +cargo test --test config_test + +# CLI commands +cargo run -- db setup --env +cargo run -- db reset --env +cargo run -- import --env +cargo run -- generate +``` + +# Config Loading + +- Files: `config.toml` → `config..toml` → `config.example.toml` (fallback) +- Gitignored: `config.toml`, `config.dev.toml`, `config.test.toml`, `config.prod.toml` +- DB names: `rusty_petroleum_dev`, `rusty_petroleum_test`, `rusty_petroleum_prod` + +# Architecture + +- Binary: `src/main.rs`, Library: `src/lib.rs` +- Test entry: `tests/common/test_db.rs` creates fresh DB per test via `cargo test --test` +- Run lib tests first to verify logic without DB dependency + +# Issue Management + +- Use Gitea REST API to close issues: + ```bash + curl -X PATCH https://gitea.rowanbrook.net/api/v1/repos/jakob/rusty-petroleum/issues/{issue_number} \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer YOUR_TOKEN" \ + -d '{"state": "closed"}' + ``` diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index d1e0bc4..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,10 +0,0 @@ -# Issue Management -- Use Gitea REST API to close issues when fixing them: - ```bash - curl -X PATCH https://gitea.rowanbrook.net/api/v1/repos/jakob/rusty-petroleum/issues/{issue_number} \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer YOUR_TOKEN" \ - -d '{"state": "closed"}' - ``` -- Or suggest closing issues on Gitea web UI when automatic closing via API is not configured -