Expert assistant for developing PRQL - a modern pipelined SQL replacement. Handles testing, compilation, error handling, and best practices.
Expert assistant for developing PRQL (Pipelined Relational Query Language) - a modern language for transforming data that serves as a simple, powerful SQL replacement.
Guides AI agents through PRQL development with proper testing strategies, error handling patterns, and compilation workflows. Optimized for fast iteration and comprehensive validation.
Follow a tiered testing approach for efficient iteration:
Run fast tests on core packages while developing:
```sh
task prqlc:test
cargo insta test -p prqlc --lib -- resolver
cargo insta test -p prqlc --test integration -- date
```
Run comprehensive tests before returning results to user:
```sh
task prqlc:pull-request
```
Only when changes affect JavaScript/Python/WASM bindings:
```sh
task test-all
```
**Note:** Test suite minimizes token usage - nextest shows only failures/slow tests, cargo builds use `--quiet`, resulting in ~52% output reduction (1128 → 540 lines).
Use inline `insta` snapshot tests for most development:
```rust
insta::assert_snapshot!(result, @"expected output");
```
Initialize tests with empty snapshots, then run with `--accept`:
```rust
insta::assert_snapshot!(result, @"");
```
Run test commands with `--accept` to automatically fill in results.
**Use inline tests** (preferred for most cases):
**Use integration tests** (`prqlc/tests/integration/queries/*.prql`) only when:
```rust
#[cfg(test)]
mod test {
use insta::assert_snapshot;
#[test]
fn test_my_feature() {
let query = "from employees | filter country == 'USA'";
assert_snapshot!(crate::tests::compile(query).unwrap(), @"");
}
}
```
View `prqlc` output for any compilation stage:
```sh
cargo run -p prqlc -- compile "from employees | filter country == 'USA'"
cargo run -p prqlc -- fmt "from employees | filter country == 'USA'"
cargo run -p prqlc -- --help
```
Never panic on user input or recoverable errors:
Avoid 2nd person (you/your). Use softer modal verbs like "might" for friendlier tone:
Run all lints before completing work:
```sh
task lint
```
Build and view crate documentation:
```sh
cargo doc -p prqlc
Read target/doc/prqlc/index.html
Read target/doc/prqlc/module_name/index.html
Read target/doc/prqlc/fn.compile.html
```
For releases or environment issues, refer to `web/book/src/project/contributing/development.md`.
1. **Start with inner loop testing** - Use `task prqlc:test` or filtered `cargo insta test` during development
2. **Write inline snapshot tests** - Add `#[cfg(test)]` module with `insta::assert_snapshot!` tests at end of modified files
3. **Initialize snapshots empty** - Use `@""` then run with `--accept` to auto-fill
4. **Handle errors properly** - Use `?` operator, never `.unwrap()` on user input
5. **Write friendly error messages** - Avoid "you/your", use "might be" phrasing
6. **Test CLI output** - Use `cargo run -p prqlc -- compile` to verify compilation results
7. **Run comprehensive tests before completion** - Execute `task prqlc:pull-request` (~30s)
8. **Run cross-binding tests if needed** - Execute `task test-all` only for JS/Python/WASM changes (~2min)
9. **Run lints** - Execute `task lint` before finalizing
10. **Document as needed** - Build docs with `cargo doc -p prqlc` and verify with Read tool
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/prql-development-assistant-y7y340/raw