module-system
Skill17 starsChanged 9 months agoApache-2.0View on GitHub
Implement module systems for organizing code, encapsulation, and namespace management.
In this repository98 other files it gives its agents.
- abstract-interpretation-engineSkill
- abstract-machineSkill
- acsl-annotation-assistantSkill
- actor-model-implementerSkill
- algebraic-effectsSkill
- alias-and-points-to-analysisSkill
- axiomatic-semanticsSkill
- bidirectional-type-checkingSkill
- bisimulation-checkerSkill
- capability-systemSkill
- closure-converterSkill
- common-subexpression-eliminatorSkill
- concurrency-verifierSkill
- constant-propagation-passSkill
- contextual-equivalenceSkill
- control-flow-analysisSkill
- coq-proof-assistantSkill
- cps-transformerSkill
- dafny-verifierSkill
- dataflow-analysis-frameworkSkill
- dead-code-eliminatorSkill
- defunctionalizationSkill
- denotational-semantics-builderSkill
- dependent-type-implementerSkill
- dsl-embeddingSkill
- effect-handlers-implementerSkill
- effect-systemSkill
- effect-type-systemSkill
- escape-analysisSkill
- existential-typesSkill
- ffi-designerSkill
- fuzzer-generatorSkill
- gadt-implementerSkill
- garbage-collector-implementerSkill
- graalvm-truffle-implementerSkill
- gradual-typing-implementerSkill
- higher-order-abstract-syntaxSkill
- hoare-logic-verifierSkill
- incremental-computationSkill
- information-flow-analyzerSkill
- inline-expanderSkill
- interprocedural-analysisSkill
- invariant-generatorSkill
- jit-compiler-builderSkill
- lambda-calculus-interpreterSkill
- language-server-protocolSkill
- lean-proverSkill
- lexer-generatorSkill
- linear-type-implementerSkill
- liveness-analysisSkill
- llvm-backend-generatorSkill
- lock-free-data-structureSkill
- loop-optimizerSkill
- loop-termination-proverSkill
- macro-expanderSkill
- memory-allocatorSkill
- message-passing-systemSkill
- mlir-dialect-designerSkill
- model-checkerSkill
- monad-transformerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Functors/Parameterized Modules: Create module-level functions
- Distinctive: line 44
Use signatures for abstraction
- Distinctive: line 46
Use functors for generic libraries
- Distinctive: line 47
Consider cyclic dependencies carefully
- Distinctive: line 85
When simple imports suffice
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Module System
Module systems provide mechanisms for organizing code, encapsulating implementation details, and managing namespaces. They are essential for building large-scale software systems.
When to Use This Skill
- Designing language module systems
- Building large codebases
- Implementing encapsulation
- Managing dependencies
- Teaching programming language design
What This Skill Does
- Namespace Management: Organize names into hierarchical namespaces
- Encapsulation: Hide implementation details
- Interface/Implementation Separation: Define signatures and structures
- Functors/Parameterized Modules: Create module-level functions
- Dependency Management: Handle module dependencies
Key Concepts
| Concept | Description |
| Module | Collection of related definitions |
| Signature | Module interface specification |
| Structure | Module implementation |
| Functor | Module-level function |
| Sealing | Hide implementation behind signature |
| Import | Use definitions from another module |
Tips
- Use signatures for abstraction
- Seal modules to hide implementation
- Use functors for generic libraries
- Consider cyclic dependencies carefully
- Separate interface from implementation
Common Use Cases
- Large-scale software organization
- Library design
- Namespace management
- Information hiding
- Dependency injection via functors
Related Skills
type-class-implementer- Alternative abstraction mechanismffi-designer- Foreign function interfacetype-checker-generator- Type checking for modules
Canonical References
| Reference | Why It Matters |
| MacQueen "Modules for Standard ML" | Original ML modules |
| Leroy "Manifest types, modules, and separate compilation" | OCaml modules |
| Dreyer "Understanding and Evolving ML Modules" | Modern treatment |
Tradeoffs and Limitations
Approach Tradeoffs
| Approach | Pros | Cons |
| Simple modules | Easy to implement | Limited abstraction |
| ML-style | Powerful abstraction | Complex |
| Mixins/Traits | Composable | No sealing |
When NOT to Use This Skill
- Small single-file programs
- When simple imports suffice
- Prototype/experimental code
Limitations
- Cyclic dependencies are tricky
- Higher-order modules are complex
- Type abstraction can be limited
Assessment Criteria
A high-quality implementation should have:
| Criterion | What to Look For |
| Encapsulation | Hides implementation |
| Namespace | Manages names properly |
| Dependencies | Handles imports correctly |
| Abstraction | Supports signatures |
Quality Indicators
✅ Good: Full encapsulation, proper namespacing, functor support ⚠️ Warning: Leaky abstraction, complex dependency handling ❌ Bad: No encapsulation, namespace pollution
Research Tools & Artifacts
Real-world module systems:
| Tool | Why It Matters |
| OCaml modules | Full-featured modules |
| ML signatures | ML module system |
| Rust modules | Simple module system |
| Java modules (JDK 9) | Java module system |
Key Systems
- GHC Haskell: Type-based modules
- Dune: OCaml build system
Research Frontiers
Current module research:
| Direction | Key Papers | Challenge |
| Hierarchical | "Hierarchical Modules" | Scale |
| Mixins | "Mixins" | Composition |
| Types | "Modules as Types" | Type-based |
Hot Topics
- Wasm modules: WebAssembly modules
- ES modules: JavaScript modules
Implementation Pitfalls
Common module bugs:
| Pitfall | Real Example | Prevention |
| Cyclic deps | Circular imports | Detect cycles |
| Name collision | Name conflicts | Namespaces |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

