Add a new learning to the agent learnings file. Use when the user says /add-learning, asks to record a lesson, or when an implementation produced a reusable insight worth preserving for future agents.
日本語の概要は準備中です。原文の説明を表示しています。
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.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
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:
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 message
For any pipeline feature (parser through emission), write both:
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.
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().
loaves/compiler/incan_emit/tests/codegen_snapshots/my_feature.incn:def example() -> str:
return "hello"
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);
}
INSTA_UPDATE=1 cargo test -p incan_emit --test codegen_snapshot_tests -- test_my_feature_codegen
cargo insta review or check loaves/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).
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).
loaves/compiler/incan_test_support/fixtures/invalid/my_error_case.incn with code that should fail.# 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_tests
# 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_tests
After tests pass, check:
.unwrap() or .expect() in test code (clippy will reject them)Resultcargo insta review)When the task is to debug a Rust compiler error, collect the full context before changing code:
rust-metadata;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.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Add a new learning to the agent learnings file. Use when the user says /add-learning, asks to record a lesson, or when an implementation produced a reusable insight worth preserving for future agents.
日本語の概要は準備中です。原文の説明を表示しています。
Transition an Incan RFC from one status to the next. Use when the user asks to promote, advance, or finalize an RFC, or says /bump-rfc. Handles Draft → Planned, Planned → In Progress, and In Progress → Implemented transitions.
日本語の概要は準備中です。原文の説明を表示しています。
Safely close out completed Incan work after a PR is merged by verifying merge status, syncing the base branch, removing task-owned local worktrees/assets, deleting merged local/remote branches, pruning refs, and reporting dirty or ambiguous leftovers. Use when the user says /closeout, asks to clean up after a merged PR, or wants local RFC/issue branch/worktree cleanup.
日本語の概要は準備中です。原文の説明を表示しています。
Drafts a GitHub issue title and body using the target repository's issue templates under .github/ISSUE_TEMPLATE. Use when the user asks to create, draft, or file a GitHub issue, bug report, feature request, chore, documentation issue, or RFC proposal, or wants issue text that matches the repo's template.
日本語の概要は準備中です。原文の説明を表示しています。
Drafts implementation plans with TDD, documentation updates, and repository verification commands before coding. Use when the user asks for an implementation plan, /create-plan, or structured pre-implementation design for work in encero workspaces (e.g. Incan, IncQL).
日本語の概要は準備中です。原文の説明を表示しています。
Generate a PR description following the repository's pull request template. Use when the user asks to create, draft, or generate a PR description for a pull request. The skill automatically locates the PR template in the target repository and fills it in based on the git diff.
日本語の概要は準備中です。原文の説明を表示しています。