AgentSkillsCN

sounio-typeck-effects

深耕 Sounio 类型检查与效应系统——包括双向推理、效应推理与强制、以及类型规则的制定与应用;在编辑 `compiler/src/typeck/`、`compiler/src/types/`、`compiler/src/check/` 或 `compiler/src/effects/` 时,此技能将助您游刃有余。

SKILL.md
--- frontmatter
name: sounio-typeck-effects
description: "Work on Sounio type checking and effect system (bidirectional inference, effect inference/enforcement, and type rules); use when editing `compiler/src/typeck/`, `compiler/src/types/`, `compiler/src/check/`, or `compiler/src/effects/`."

Sounio Typeck + Effects

Overview

Make changes to the type system and effect checker without drifting toward Rust or weakening Sounio’s explicit-effects contract.

Workflow

1) Anchor to language identity and current reality

  • Read CLAUDE.md for Sounio-native syntax constraints.
  • Check compiler/docs/KNOWN_LIMITATIONS.md before implementing surface syntax the compiler doesn’t support yet.
  • Treat spec/LANGUAGE_SPECIFICATION.md as aspirational when it disagrees with the compiler.

2) Identify what layer you’re changing

  • Parser/AST shape: compiler/src/parser/, compiler/src/ast/
  • Type rules / inference: compiler/src/check/, compiler/src/typeck/, compiler/src/types/
  • Effects enforcement + inference: compiler/src/effects/ and compiler/src/types/effects.rs

3) Protect effect soundness

  • If an operation performs IO/mutation/allocation/etc, ensure the effect set includes it.
  • If an operation changes epistemic confidence/provenance, decide whether it must be effectful and enforce it consistently.

4) Add high-signal tests

  • Rust integration: compiler/tests/ (e.g. semantic types and effects)
  • Diagnostics expectations: tests/ui/
  • Language harness: tests/run-pass/, tests/compile-fail/

References

  • Typeck map: references/typeck-navigation.md
  • Effects map: references/effects-navigation.md
  • Claude command reference: .claude/commands/sounio-effects.md