Crates.io | fargin |
lib.rs | fargin |
version | |
source | src |
created_at | 2024-12-04 00:36:05.903424 |
updated_at | 2024-12-04 07:56:04.090576 |
description | A flexible Rust library for managing project development with integrated configuration and AI-assisted guidance |
homepage | https://github.com/adversarial-systems/fargin.git |
repository | https://github.com/adversarial-systems/fargin.git |
max_upload_size | |
id | 1470843 |
Cargo.toml error: | TOML parse error at line 26, column 1 | 26 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Fargin is a Rust library that acts as a progress-driven design document manager for LLM-assisted development. It keeps LLMs focused on your project's specific goals and design intentions, preventing them from getting sidetracked or caught in local optimization loops.
The core purpose of Fargin is to "point to the sign" - maintaining a clear reference point for:
This allows developers to:
cargo install fargin
Add this to your Cargo.toml
:
[dependencies]
fargin = "0.1.61"
# Or for minimal installation without CLI features:
fargin = { version = "0.1.61", default-features = false, features = ["minimal"] }
The library provides a CLI with the following commands:
fargin init [path]
fargin validate [path]
fargin progress [path]
fargin suggest [path]
fargin reset [path] [--force]
Use the --force
flag to skip confirmation prompt.
use anyhow::Result;
use fargin::config::ProjectConfig;
use std::path::PathBuf;
#[tokio::main]
async fn main() -> Result<()> {
// Initialize project with clear goals and design principles
let mut config = ProjectConfig::new(
"My Project".to_string(),
"A focused project with clear design goals".to_string(),
);
// Add specific project goals
config.goals.push("Implement efficient data processing pipeline".to_string());
config.goals.push("Maintain strict type safety across interfaces".to_string());
// Save configuration
let project_dir = PathBuf::from("my_project");
config.save(&project_dir)?;
// Validate project
fargin::validation::validate_project(project_dir.clone())?;
// Show progress
fargin::progress::show_progress(project_dir)?;
Ok(())
}
use fargin::config::{ProjectConfig, ProgressMarker};
struct MyAIProject {
config: ProjectConfig,
project_dir: PathBuf,
}
impl MyAIProject {
async fn new(name: &str, description: &str) -> Result<Self> {
let project_dir = PathBuf::from(format!("projects/{}", name));
let config = ProjectConfig::new(name.to_string(), description.to_string());
config.save(&project_dir)?;
Ok(Self { config, project_dir })
}
async fn track_progress(&mut self, marker: &str) -> Result<()> {
self.config.progress_markers.push(ProgressMarker {
name: marker.to_string(),
description: "".to_string(),
completed: false,
completed_at: None,
});
self.config.save(&self.project_dir)?;
Ok(())
}
}
### Progress Tracking
```rust
use fargin::progress::show_progress;
// Check current progress against defined goals
let progress = show_progress(project_dir)?;
println!("Project completion: {}%",
(progress.completed_markers as f32 / progress.total_markers as f32) * 100.0);
When working with LLMs on software projects, it's easy for the AI to get caught in local minima - focusing too much on optimizing small details while losing sight of the bigger picture. Fargin solves this by:
When initialized, the project creates the following directory structure:
.fargin/
├── config.toml # Project configuration
├── prompts/ # LLM prompt templates
├── history/ # Development history
└── templates/ # Project templates
The project configuration is stored in .fargin/config.toml
and includes:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2024 adversarial.systems -- Fargin Contributors