Expert guidance for developing and maintaining the Project Generator Rust CLI tool. Provides MCP context7 documentation lookup, architecture patterns, and development workflows.
Expert assistant for developing and maintaining the Project Generator Rust CLI tool.
Project Generator is a Rust-based CLI tool for generating projects from templates with GitHub integration. This skill provides guidance on architecture, development workflows, and best practices specific to this codebase.
**CRITICAL**: Always query MCP context7 server FIRST for the following technologies before using general knowledge:
When the user asks for help with Project Generator:
1. **Check Technology Stack**: Identify if the question involves Rust, Cargo, Clap, Serde, Tokio, Reqwest, Git2, or Regex.
2. **Query MCP Context7**: If the question involves any priority technology, use MCP context7 to look up current documentation before providing guidance.
3. **Understand Project Architecture**:
- `src/cli/`: CLI interface and command handling
- `src/config/`: Configuration file parsing (YAML/JSON)
- `src/generate/`: Core project generation logic
- `src/github/`: GitHub API integration and repository operations
- `src/template/`: Template processing and variable replacement
- `src/utils/`: Utility functions (context, validation, strings, errors)
4. **Use Standard Development Workflows**:
```bash
# Building
cargo build --release
# Running
cargo run # Interactive mode
cargo run -- --config config.yaml # With config
cargo run -- --remote --config config.yaml # GitHub mode
cargo run -- --debug # Debug mode
# Testing
cargo test # All tests
cargo test --lib # Library tests
# Code Quality
cargo fmt # Format
cargo clippy # Lint
cargo check # Type check
```
5. **Handle Environment Variables**:
- `GITHUB_TOKEN`: Required for remote GitHub mode
- `DEBUG`: Enables debug output
6. **Follow Error Handling Patterns**:
- Use custom error types from `src/utils/error.rs`
- Propagate errors with `?` operator
- Provide user-friendly CLI error messages
7. **Maintain Code Quality**:
- Run `cargo fmt` before committing
- Address all `cargo clippy` warnings
- Add tests for new functionality
- Keep module organization clear with public APIs
8. **Key Dependencies to Understand**:
- **clap**: CLI argument parsing with derive macros
- **inquire**: Interactive user prompts
- **serde/serde_json/serde_yaml**: Configuration serialization
- **regex**: Template variable replacement
- **git2**: Git repository operations
- **reqwest**: GitHub API HTTP client
- **tokio**: Async runtime for concurrent operations
**Example 1: User asks about adding a new CLI flag**
1. Query MCP context7 for Clap derive macro documentation
2. Locate `src/args.rs` for argument definitions
3. Add new field with appropriate Clap attributes
4. Update help text and validation in `src/cli/`
5. Run `cargo clippy` and `cargo test`
**Example 2: User wants to improve GitHub API error handling**
1. Query MCP context7 for Reqwest error handling patterns
2. Review `src/github/` module
3. Update error types in `src/utils/error.rs` if needed
4. Add specific error variants for GitHub API failures
5. Improve user-facing error messages
6. Add tests for error scenarios
**Example 3: User needs to add template variable validation**
1. Query MCP context7 for Regex patterns
2. Review `src/template/` module for current validation
3. Add new validation rules in `src/utils/validation.rs`
4. Update template processing logic
5. Add unit tests for validation cases
6. Update documentation in config examples
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/project-generator-developer/raw