Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"permissions": {
"allow": [
"Bash(cargo clippy:*)",
"mcp__git__git_checkout",
"mcp__git__git_log",
"mcp__git__git_diff",
"Bash(cargo check:*)",
"Bash(rg:*)",
"Bash(find:*)",
"Bash(ls:*)",
"mcp__git__git_show",
"mcp__git__git_diff_unstaged",
"WebFetch(domain:platform.openai.com)",
"Bash(grep:*)",
"Bash(gh issue view:*)"
],
"deny": []
}
}
17 changes: 16 additions & 1 deletion .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ env:
RUSTFLAGS: "-Dwarnings"

jobs:
audit:
name: Audit Dependencies
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: Install cargo-audit
run: cargo install cargo-audit --locked

- name: Run dependency security audit
run: cargo audit

check:
name: Check
runs-on: ubuntu-latest
Expand All @@ -28,7 +43,7 @@ jobs:
run: cargo fmt --all -- --check

- name: Run Clippy lints
run: cargo clippy --all-targets --all-features
run: cargo clippy --workspace --all-targets --all-features

test:
name: Test
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/target
Cargo.lock
.env
32 changes: 32 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Repository Guidelines

## Project Structure & Module Organization

This is a Rust workspace with the main `rsai` crate at the repository root and a procedural macro crate in `macros/`. Core library code lives in `src/`: `core/` contains builder, trait, error, HTTP, and type abstractions; `provider/` contains OpenAI, OpenRouter, Gemini, and provider constants; `responses/` and `completions/` contain request/response client flows. Integration tests are in `tests/`; macro tests, including `trybuild` UI cases, are in `macros/tests/`. Runnable usage examples are in `examples/`.

## Build, Test, and Development Commands

- `cargo build` builds the full workspace.
- `cargo test` runs unit, integration, and macro crate tests.
- `cargo test test_name` runs a focused test by name.
- `cargo run --example function-calling` runs an example; replace the name with any example listed in `Cargo.toml`.
- `cargo fmt` formats Rust code with the toolchain-pinned `rustfmt`.
- `cargo clippy --all --all-features -- -Dwarnings` runs the stricter pre-commit lint pass.

The repository pins stable Rust with `rust-toolchain.toml` and declares MSRV `1.85`.

## Coding Style & Naming Conventions

Use Rust 2024 idioms and standard `rustfmt` formatting. Prefer strong typed APIs, enums, `Option<T>`, and the existing builder and trait patterns over ad hoc configuration. Use `snake_case` for functions, modules, variables, and test names; use `CamelCase` for types, traits, and enum variants. Public APIs should have doc comments. Inline comments should explain only non-obvious behavior. Errors should use the existing `LlmError` style with `thiserror`.

## Testing Guidelines

Add or update tests near the affected behavior. Use root-level `tests/*.rs` for public API and provider behavior, and `macros/tests/` for procedural macro behavior. UI compile-fail cases belong in `macros/tests/ui/` with matching `.stderr` files. Before submitting, run `cargo test`, then `cargo clippy --all --all-features -- -Dwarnings`.

## Commit & Pull Request Guidelines

Recent history uses concise imperative subjects such as `Track Rust stable locally and declare MSRV 1.85`, with occasional prefixes like `fix:`, `feature:`, and `chore:`. Keep commits focused and describe the user-visible change or maintenance task. Pull requests should include a short summary, tests run, linked issue when applicable, and notes for API or behavior changes.

## Security & Configuration Tips

Do not commit API keys, `.env` files, or broad local agent permission files. Keep Claude or Codex local settings narrow; avoid blanket command approvals such as unrestricted `cargo:*`, because builds, tests, examples, build scripts, and proc macros can execute code.
Loading
Loading