# ryo-suggest
[](https://crates.io/crates/ryo-suggest)
[](https://docs.rs/ryo-suggest)
[](#license)
> **Status:** experimental. APIs may change in v0.x.
> Part of the [ryo](https://github.com/ynishi/ryo-rs) workspace —
> AST-centric Rust programming for AI agents.
Continuous-refactoring suggestion engine. Detects code-improvement
opportunities via pattern matching, then generates `MutationSpec`s
that downstream `ryo-executor` can apply. Suggestions are categorised
by safety level (Auto / Manual / Review) so callers can filter.
## Install
```sh
cargo add ryo-suggest
```
## Quickstart
```rust,ignore
use ryo_suggest::{SuggestService, SuggestRegistry, SuggestQuery, SafetyLevel};
let mut registry = SuggestRegistry::new();
registry.register(MyPattern::new());
let service = SuggestService::new(registry);
let count = service.detect(&ctx, &symbols);
let auto_safe = service.query(
&SuggestQuery::all().with_max_safety(SafetyLevel::Auto)
);
for (id, _, _) in auto_safe {
if let Some(specs) = service.to_mutation_specs(id, &ctx) {
// Hand specs to ryo-executor
}
}
```
## API Summary
| `SuggestRegistry` | Register pattern detectors |
| `SuggestStore` | Persistent storage for opportunities |
| `SuggestService` | Detect + query + spec generation |
| `Suggest` / `SuggestOpportunity` | Suggestion data types |
| `SuggestCategory` / `SafetyLevel` | Classification axes |
| `SuggestQuery` | Filter builder |
## Status
**Experimental.** Suggestion data model and detection API are evolving.
Production-quality stability is deferred to v1.0.
## License
Licensed under either of [Apache-2.0](https://github.com/ynishi/ryo-rs/blob/main/LICENSE-APACHE)
or [MIT](https://github.com/ynishi/ryo-rs/blob/main/LICENSE-MIT) at your option.