-
Notifications
You must be signed in to change notification settings - Fork 1
all comments and docs are autogenrated #15
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| .* | ||
| .idea | ||
| .prompts_perssitense_cache | ||
| .prompts_perssitense_cache |
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.
Cache directory mismatch will cause cache files to be committed to git. The .gitignore specifies .prompts_perssitense_cache but the code uses .prompts_cache (see examples/basic_usage.rs line 14 and TUTORIAL.md line 74). This means the actual cache directory won't be ignored.
Fix by changing to:
.prompts_cache
| .prompts_perssitense_cache | |
| .prompts_cache |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
|
Caution Review failedThe pull request is closed. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThis PR introduces user-facing documentation and a practical example for the RigScribe Rust crate. A new TUTORIAL.md provides an end-to-end guide for prompt engineering automation with caching, while examples/basic_usage.rs demonstrates core API usage patterns. Minor .gitignore updates exclude cache and debug files. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (3)
Comment |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
| .* | ||
| .idea | ||
| .prompts_perssitense_cache | ||
| .prompts_perssitense_cache |
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.
// In .gitignore, replace the incorrect entry with:
.prompts_cacheThere's a mismatch between the cache directory name used in the code and the entry in .gitignore. The code in TUTORIAL.md (line 74) and examples/basic_usage.rs (line 14) creates a directory named .prompts_cache. However, .gitignore is configured to ignore .prompts_perssitense_cache. This will cause the generated cache files to be tracked by git. Let's update .gitignore to match the directory name used in the code.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| ```rust | ||
| use rigscribe::RigScribe; | ||
|
|
||
| let artifact = RigScribe::optimize_agentic("Explain Quantum Physics like a pirate").await?; |
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.
use rigscribe::{RigScribe, Result};
#[tokio::main]
async fn main() -> Result<()> {
let artifact = RigScribe::optimize_agentic("Explain Quantum Physics like a pirate").await?;
println!("\n--- Agentic-Optimized System Prompt ---\n");
println!("{}", artifact.system_prompt);
Ok(())
}The code snippet for optimize_agentic is not a complete, runnable example. It uses .await outside of an async function, which will cause a compilation error, preventing users from testing this feature.
To ensure the example is immediately usable, it should be wrapped in a minimal async main function, similar to the primary example in the tutorial. This provides a complete, copy-paste-runnable demonstration of the feature.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| use rigscribe::{RigScribe, ScopeId, Result}; | ||
| use std::env; | ||
|
|
||
| #[tokio::main] |
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.
// In TUTORIAL.md, update the code block to match the example:
use rigscribe::{RigScribe, ScopeId, Result};
use std::env;
#[tokio::main]
async fn main() -> Result<()> {
// Ensure API key is set
if env::var("GEMINI_API_KEY").is_err() {
eprintln!("Error: GEMINI_API_KEY environment variable is not set.");
return Ok(());
}
let scribe = RigScribe::new("./.prompts_cache");
let raw_request = "I want an AI assistant that helps users write Clap CLI tools in Rust.";
let feature_id = ScopeId(101);
println!("Refining prompt for: '{}'...", raw_request);
match scribe.optimize_with_cache(raw_request, feature_id).await {
Ok(artifact) => {
println!("\n--- Optimized System Prompt ---\n");
println!("{}", artifact.system_prompt);
}
Err(e) => {
eprintln!("Error optimizing prompt: {}", e);
}
}
Ok(())
}The code example in the tutorial (TUTORIAL.md) is a simplified version of the one in examples/basic_usage.rs. The official example includes an important check for the GEMINI_API_KEY and demonstrates more robust error handling with a match statement. To provide users with a more complete and safer starting point, it's best to align the tutorial's code with the best practices shown in the example file. This helps prevent runtime errors and confusion.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| #[tokio::main] | ||
| async fn main() -> Result<()> { | ||
| // Ensure API key is set | ||
| if env::var("GEMINI_API_KEY").is_err() { |
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.
if env::var("GEMINI_API_KEY").is_err() {
eprintln!("Error: GEMINI_API_KEY environment variable is not set.");
std::process::exit(1);
}
// ...
let artifact = scribe.optimize_with_cache(raw_request, feature_id).await?;
println!("\n--- Optimized System Prompt ---\n");
println!("{}", artifact.system_prompt);
Ok(())The application currently exits with a success code (0) even when critical errors occur, such as a missing API key or a failure during prompt optimization. This is misleading for users and masks failures in automated scripts.
In command-line applications, it's crucial to signal failure with a non-zero exit code. Since the main function already returns a Result<()>, you should propagate errors instead of just printing them and returning Ok(()).
By using the ? operator, any error from optimize_with_cache will be automatically returned from main, causing the program to exit correctly. For the API key check, explicitly exiting with a non-zero status code achieves the same result.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
398cad7 to
eac2dbc
Compare
477b396 to
82f76ae
Compare
82f76ae to
0215785
Compare

TL;DR
Added a comprehensive tutorial and basic usage example for RigScribe.
What changed?
TUTORIAL.mdwith detailed instructions on using RigScribe for automated prompt engineeringexamples/basic_usage.rsfile demonstrating the core functionality.gitignoreto exclude logs and debug report filesHow to test?
TUTORIAL.mdfor accuracy and completenessWhy make this change?
To provide clear documentation and practical examples for users getting started with RigScribe. The tutorial explains core concepts like Intent vs. Artifact, ScopeId, caching, and the prompt refinement process, while the example demonstrates the implementation of these concepts in a real-world scenario.
This pull request significantly enhances the user experience by adding comprehensive documentation and a runnable example for the RigScribe library.
Key changes include:
TUTORIAL.md: This new guide provides a step-by-step introduction to RigScribe, covering core concepts such as Intent vs. Artifact, ScopeId, and caching. It includes a full code example demonstrating how to generate and optimize system prompts, explains the underlying "Refinery" agent workflow, and outlines advanced usage scenarios.examples/basic_usage.rs: A new, runnable Rust example is provided, mirroring the code in the tutorial, to demonstrate the basic usage of RigScribe for optimizing system prompts with caching..gitignore: AddedlogsandSTREAMING_DEBUG_REPORT.mdto the ignore list to prevent generated log and debug files from being committed.Summary by CodeRabbit
Release Notes
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.