test
Skill73 starsChanged 5 days agoApache-2.0View on GitHub
Run and write tests for the Incan compiler. Use when the user asks to test changes, add tests, run the test suite, verify a feature, or says /test. Guides test selection, provides correct patterns, and runs the right commands.
179 other projects use a version of this.
Adopted by
Most recently taken up by
- tyrantpiper/travel-pwatheir own version, first seen Nov 8, 2026
- phuthuycoding/kanban-flowtheir own version, first seen Nov 8, 2026
- pche-broken-artist/forge-of-thoughttheir own version, first seen Nov 8, 2026
- PMDevSolutions/Flaviantheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
Used with
Projects with it also use agent-context-isolation, agentica-infrastructure and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
parcadeiSkillagent-context-isolation
Agent Context Isolation
Also in 3 projects that use this
parcadeiSkillagentica-infrastructure
Reference guide for Agentica multi-agent infrastructure APIs
Also in 3 projects that use this
- +10 more from parcadei
Other versions179 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 179
- react/react★ 252ksame name
- facebook/react★ 252ksame name
- apache/skywalking★ 25ksame name
- livewire/livewire★ 24ksame name
- NVIDIA/TensorRT★ 13ksame name
- FalkorDB/FalkorDB★ 10ksame name
- FastLED/FastLED★ 7.5ksame name
- fleetdm/fleet★ 7.2ksame name
- parcadei/Continuous-Claude★ 3.9ksame name
- parcadei/Continuous-Claude-v2★ 3.9ksame name
169 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-learningSkill
- bump-rfcSkill
- closeoutSkill
- create-github-issueSkill
- create-planSkill
- create-pr-descriptionSkill
- fixSkill
- flag-compiler-bugSkill
- fleet-auditSkill
- hello-worldSkill
- loopSkill
- orchestrate-parallel-workSkill
- ralph-loopSkill
- review-and-fixSkill
- review-architectureSkill
- review-code-smellsSkill
- review-docs-claimsSkill
- review-incan-source-qualitySkill
- review-orchestrateSkill
- review-rfcSkill
- review-rust-proseSkill
- review-scopeSkill
- reviewSkill
- review-test-styleSkill
- start-workSkill
- write-commit-messageSkill
- write-rfcSkill
- yeet-prSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 154 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Read 2-3 nearby tests or fixtures that already cover a similar behavior shape.
- Very specific: line 111
Important: test functions that do fallible work must return Result and use ?
- Very specific: line 162
Create loaves/compiler/incan_test_support/fixtures/invalid/my_error_case.incn with code that should fail.
- Distinctive: line 163
Add an integration test that asserts the expected diagnostic.
- Distinctive: line 198
After tests pass, check:
- Distinctive: line 207
When the task is to debug a Rust compiler error, collect the full context before changing code:
“Common” is measured: kept by at least 6 in 10 of the 154 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test — Incan Compiler
Step 1: Determine what changed
Identify which compiler stages are affected by the current changes:
| Change area | Stages affected |
| New syntax or keyword | Parser, Typechecker, Lowering, Emission |
| New semantic rule or validation | Typechecker |
| New or changed codegen output | Lowering, Emission |
| Stdlib addition | Typechecker (loader), Emission, possibly Runtime |
| CLI behavior | Integration tests |
| Formatter change | Property tests, integration tests |
For non-trivial changes, do a quick pattern intake before writing or changing tests:
- Identify the active area and downstream stages the behavior must survive.
- Read 2-3 nearby tests or fixtures that already cover a similar behavior shape.
- Name the source-of-truth boundary, such as the RFC, diagnostics catalog, stdlib registry, ownership policy, CLI reference, or docs contract.
- Pick the narrowest failing test first, then the downstream verification that proves the behavior reaches the right stage.
Step 2: Pick the right tests to write
Decision tree
Did you change the parser?
→ Add a test to the subject's module under loaves/kernel/incan_syntax/src/parser/tests/ (shared helpers live in helpers.rs)
Did you change the typechecker?
→ Add a test to the subject's module under loaves/compiler/incan_frontend/src/typechecker/tests/ (shared helpers live in helpers.rs)
Did you change lowering or emission (codegen output)?
→ Add a .incn file in loaves/compiler/incan_emit/tests/codegen_snapshots/
→ Add a test function in loaves/compiler/incan_emit/tests/codegen_snapshot_tests.rs
→ Run: INSTA_UPDATE=1 cargo test -p incan_emit --test codegen_snapshot_tests
Did you change end-to-end behavior (CLI, build, multi-file)?
→ Add a test in loaves/toolchain/incan-cli/tests/integration_tests.rs
Did you change the formatter?
→ Property tests in loaves/compiler/incan_format/tests/property_tests.rs verify idempotency
→ Also add a codegen snapshot if formatting affects output
Did you add a diagnostic?
→ Add a fixture in loaves/compiler/incan_test_support/fixtures/invalid/ that triggers it
→ Add an integration test that asserts the diagnostic messageWhat to always do
For any pipeline feature (parser through emission), write both:
- A unit test at the stage you changed (parser or typechecker)
- A codegen snapshot test that exercises the feature in expressions, not just declarations
Step 3: Write the tests
Parser test pattern
Directory: loaves/kernel/incan_syntax/src/parser/tests/ — one module per subject (for example expressions.rs, patterns_and_matching.rs, modules_and_imports.rs); a module starts with use super::*;, which brings in the parser namespace and crate imports from mod.rs and the shared helpers from helpers.rs (a module whose tests spell everything as crate:: paths omits it). Add a test to the module whose subject it belongs to, and keep every module under the inventory's 1,500-line split threshold.
#[test]
fn test_parse_my_feature() -> Result<(), Vec<CompileError>> {
let source = r#"
model Example:
field: str
"#;
let program = parse_str(source)?;
assert_eq!(program.declarations.len(), 1);
Ok(())
}Helpers available from helpers.rs: parse_str(source), parse_str_err(source, context), require_source_span(source, needle, occurrence) and the require_*_decl accessors; parse_str_with_module_path(source, path) is private to modules_and_imports.rs.
Typechecker test pattern
Directory: loaves/compiler/incan_frontend/src/typechecker/tests/ — one module per subject (for example traits.rs, narrowing_and_matching.rs, rust_imports_and_types.rs); every module starts with use super::*;, which brings in the crate imports from mod.rs and the shared helpers from helpers.rs. Add a test to the module whose subject it belongs to, and keep every module under the inventory's 1,500-line split threshold.
#[test]
fn test_my_feature_valid() {
assert_check_ok(r#"
def example() -> str:
return "hello"
"#);
}
#[test]
fn test_my_feature_invalid() {
let result = check_str(r#"
def example() -> int:
return "hello"
"#);
assert!(result.is_err());
let errs = result.unwrap_err();
assert!(errs.iter().any(|e| e.message.contains("expected")));
}Helpers available: check_str(source), assert_check_ok(source), check_str_with_library_index(source, index).
Important: test functions that do fallible work must return Result and use ?. Never use .unwrap() or .expect().
Codegen snapshot test pattern
- Create
loaves/compiler/incan_emit/tests/codegen_snapshots/my_feature.incn:
def example() -> str:
return "hello"- Add to
loaves/compiler/incan_emit/tests/codegen_snapshot_tests.rs:
#[test]
fn test_my_feature_codegen() {
let source = load_test_file("my_feature");
let rust_code = generate_rust(&source);
insta::assert_snapshot!("my_feature", rust_code);
}- Generate the snapshot:
INSTA_UPDATE=1 cargo test -p incan_emit --test codegen_snapshot_tests -- test_my_feature_codegen- Review:
cargo insta reviewor checkloaves/compiler/incan_emit/tests/snapshots/codegen_snapshot_tests__my_feature.snap.
Helpers available: load_test_file(name) (loads from loaves/compiler/incan_emit/tests/codegen_snapshots/<name>.incn), generate_rust(source), generate_rust_with_widgets_manifest(source) (for library import tests).
Integration test pattern
File: loaves/toolchain/incan-cli/tests/integration_tests.rs
#[test]
fn test_my_feature_compiles() -> Result<(), Vec<String>> {
compile_source(r#"
def main():
let x: str = "hello"
print(x)
"#)
}Helpers available: compile_source(source), compile_file(path).
Invalid fixture pattern
- Create
loaves/compiler/incan_test_support/fixtures/invalid/my_error_case.incnwith code that should fail. - Add an integration test that asserts the expected diagnostic.
Step 4: Run the tests
During development (targeted)
# Run a specific test
cargo test -p incan_emit --test codegen_snapshot_tests -- test_my_feature
# Run all typechecker tests
cargo test -p incan_frontend --lib typechecker::tests
# Run all parser tests
cargo test -p incan_syntax --lib parser::tests
# Run integration tests
cargo test -p incan-cli --test integration_testsBefore finishing (full suite)
# Full test suite
make test
# Full pre-commit gate (full checks + smoke-test-fast)
make pre-commit
# Update all snapshots if codegen changed
INSTA_UPDATE=1 cargo test -p incan_emit --test codegen_snapshot_testsStep 5: Verify
After tests pass, check:
- No
.unwrap()or.expect()in test code (clippy will reject them) - Test functions that do fallible work return
Result - Codegen snapshots are updated (no pending
cargo insta review) - Both valid and invalid cases are covered for new diagnostics
Rust compiler error workflow
When the task is to debug a Rust compiler error, collect the full context before changing code:
- exact command that failed;
- full diagnostic text, including error code, notes, help text, and secondary spans;
- active features or build mode, especially default build vs.
rust-metadata; - relevant function signature and nearby type definitions;
- local precedent files or tests that show the intended pattern.
Classify the root cause before proposing a fix: lifetime/borrow across an await or compiler boundary, missing trait bound, feature-gate/build-mode mismatch, orphan/coherence rule, missing import, or incomplete parser/typechecker/lowering/emission wiring. Prefer fixing the owning boundary over adding local conversion or clone workarounds.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

