jans / jans-cedarling
AGENTS.md653 starsChanged 5 years agoApache-2.0View on GitHub
Build: - cargo build --workspace - Build all workspace members - cargo build -p cedarling - Build main cedarling crate - cargo build --release - Build with optimizations Lint: - cargo clippy --workspace - Run clippy linter - cargo fmt --check - Check formatting compliance - See clippy.toml for project-specific lint rules Test: - cargo test --workspace - Run all workspace tests - cargo test -p cedarling - Run main crate tests - cargo test -p cedarling --test authorize_unsigned -…
- Installs packages
We split this AGENTS.md into the rules it gives an agent
30 rules. About 0 are common, 21 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Use rustfmt with project's rustfmt.toml settings
- Distinctive: line 35
Use 4-space indentation (no tabs)
- Distinctive: line 39
Use imports_granularity = "Module"
- Distinctive: line 40
Follow existing patterns in codebase
- Distinctive: line 43
Use snake_case for variables, functions, modules
- Distinctive: line 44
Use PascalCase for types, traits, enums
- Very specific: line 45
Use SCREAMING_SNAKE_CASE for constants
- Distinctive: line 46
Follow Rust naming conventions
- Distinctive: line 49
Use thiserror for custom error types
- Distinctive: line 50
Prefer Result<T, E> over panics
- Distinctive: line 51
Use derive_more for error derivation when needed
- Distinctive: line 56
Use typed-builder for complex struct construction
- Distinctive: line 58
Use smol_str for string optimization where appropriate
- Distinctive: line 59
Prefer strong typing over stringly-typed APIs
- Very specific: line 63
Use the most restrictive visibility level possible: private (no modifier) better than pub(super), pub(super) better than pub(crate), …
- Distinctive: line 68
Use standard Rust docstrings without Python-style sections
- Distinctive: line 69
Document public API items
- Distinctive: line 70
Keep documentation concise, focus on "why" not "what"
- Distinctive: line 72
Preferred style: Use standard Rust docstrings without Python-style sections
- Distinctive: line 76
Only add explanatory comments when necessary
- Very specific: line 80
Place integration tests in src/tests/ directory
- Distinctive: line 81
Use test_utils crate for shared test helpers
- Distinctive: line 82
Follow existing test patterns in authorize_*.rs files
- Distinctive: line 87
All assertions must include a descriptive message explaining what is being tested
- Very specific: line 88
Use expect_err("explicit comment") instead of panic() when expecting errors
- Very specific: line 102
When changing any default value, default behavior, or adding/removing a CEDARLING_* bootstrap property: update this YAML in the same change …
- Very specific: line 107
After making changes to bindings/cedarling_python, always validate the .pyi files in bindings/cedarling_python/cedarling_python
- Distinctive: line 108
Check if type hints need adjustment to match Rust interface changes
- Very specific: line 111
Run Python tests to ensure bindings work correctly: cd bindings/cedarling_python && python -m pytest , if it's not installed install by …
- Very specific: line 112
Use mypy to validate type annotations: mypy cedarling_python, if it's not installed install by using pip install mypy.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md - Jans Cedarling Codebase Guidelines
Build/Lint/Test Commands
Build:
cargo build --workspace- Build all workspace memberscargo build -p cedarling- Build main cedarling cratecargo build --release- Build with optimizations
Lint:
cargo clippy --workspace- Run clippy lintercargo fmt --check- Check formatting compliance- See clippy.toml for project-specific lint rules
Test:
cargo test --workspace- Run all workspace testscargo test -p cedarling- Run main crate testscargo test -p cedarling --test authorize_unsigned- Run specific test filecargo test -- --nocapture- Show test outputcargo llvm-cov- Generate code coverage report
Benchmarks:
cargo bench -p cedarling- Run benchmarkspython3 scripts/check_benchmarks.py- Format benchmark results
Documentation:
cargo doc -p cedarling --no-deps --open- Generate and open docs
Code Style Guidelines
Formatting:
- Use rustfmt with project's rustfmt.toml settings
- Max line width: 100 characters
- Imports layout: HorizontalVertical with StdExternalCrate grouping
- Use 4-space indentation (no tabs)
Imports:
- Group imports: std/external crates first, then internal modules
- Use imports_granularity = "Module"
- Follow existing patterns in codebase
Naming:
- Use snake_case for variables, functions, modules
- Use PascalCase for types, traits, enums
- Use SCREAMING_SNAKE_CASE for constants
- Follow Rust naming conventions
Error Handling:
- Use thiserror for custom error types
- Prefer Result<T, E> over panics
- Use derive_more for error derivation when needed
- Include context in error messages
- Never use runtime validation that can panic (e.g.
assert!,expect,unwrap) for input validation in production code. UseResultand propagate errors through the type system instead. The only exceptions are invariants that are statically guaranteed by the type system or explicitly agreed with the user.
Types:
- Use typed-builder for complex struct construction
- Leverage serde for serialization/deserialization
- Use smol_str for string optimization where appropriate
- Prefer strong typing over stringly-typed APIs
- Make invalid states unrepresentable: use enums, newtypes, and the type system to encode constraints at compile time. Avoid runtime checks where a more precise type can guarantee correctness statically.
Visibility:
- Use the most restrictive visibility level possible: private (no modifier) better than
pub(super),pub(super)better thanpub(crate),pub(crate)better thanpub. pubitems must always be exported in the rootlib.rsto be truly public.- Be extremely careful about what you make public; prefer to expose minimal API surface.
Documentation:
- Use standard Rust docstrings without Python-style sections
- Document public API items
- Keep documentation concise, focus on "why" not "what"
- Include examples for complex functionality
- Preferred style: Use standard Rust docstrings without Python-style sections
- Good:
/// Creates a new TokenCache with the specified maximum TTL in seconds. /// If max_ttl is set to 0, tokens will use their natural expiration or default TTL. - Avoid: Python-style sections like
# Arguments,# Returns - Rust's documentation generator automatically handles parameter documentation from function signatures
- Only add explanatory comments when necessary
- The function signature already tells us the "what" - focus on the "why"
Testing:
- Place integration tests in src/tests/ directory
- Use test_utils crate for shared test helpers
- Follow existing test patterns in authorize_*.rs files
- Include both positive and negative test cases
- For success checking, use
result.expect("descriptive message")instead ofassert!(result.is_ok()) - For error checking, use
result.expect_err("descriptive message")instead ofassert!(result.is_err()) - For pattern matching errors, use
assert!(matches!(...), "descriptive message") - All assertions must include a descriptive message explaining what is being tested
- Use
expect_err("explicit comment")instead ofpanic()when expecting errors
File Headers:
- Each Rust file must contain the Apache 2.0 license header:
// This software is available under the Apache-2.0 license.
// See https://www.apache.org/licenses/LICENSE-2.0.txt for full text.
//
// Copyright (c) 2024, Gluu, Inc.Default Config Sample
cedarling/config/default_config.yamlis a user-facing sample. Keep it consistent with the real defaults in code (e.g.JwtConfig::default,BootstrapConfigRawdefaults) and withdocs/cedarling/reference/cedarling-properties.md.- When changing any default value, default behavior, or adding/removing a
CEDARLING_*bootstrap property: update this YAML in the same change so the sample never contradicts the documented or compiled-in defaults.
Python Bindings Validation
When working with Python bindings:
- After making changes to
bindings/cedarling_python, always validate the.pyifiles inbindings/cedarling_python/cedarling_python - Check if type hints need adjustment to match Rust interface changes
- Before running tests, ensure Python virtual environment is activated if available
- To build updated python bindings execute
cd bindings/cedarling_python && maturin developif you have error during execution read readme filebindings/cedarling_python/README.md - Run Python tests to ensure bindings work correctly:
cd bindings/cedarling_python && python -m pytest, if it's not installed install by usingpip install pytest. - Use
mypyto validate type annotations:mypy cedarling_python, if it's not installed install by usingpip install mypy.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- llms.txtllms.txt
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

