Type Theory

Expert skill in type theory foundations for implementing type systems including inference, checking, and subtyping

509 stars

Best use case

Type Theory is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Expert skill in type theory foundations for implementing type systems including inference, checking, and subtyping

Teams using Type Theory should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/type-theory/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/programming-languages/skills/type-theory/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/type-theory/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Type Theory Compares

Feature / AgentType TheoryStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Expert skill in type theory foundations for implementing type systems including inference, checking, and subtyping

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Type Theory Skill

## Overview

Expert skill in type theory foundations for implementing type systems including inference, checking, and subtyping.

## Capabilities

- Implement Hindley-Milner type inference with Algorithm W
- Implement constraint-based type inference with unification
- Design and implement bidirectional type checking
- Implement structural and nominal subtyping
- Handle variance (covariant, contravariant, invariant)
- Implement row polymorphism and record types
- Design flow-sensitive type narrowing
- Implement type error message generation

## Target Processes

- type-system-implementation.js
- semantic-analysis.js
- generics-polymorphism.js
- effect-system-design.js

## Dependencies

Academic type theory literature (TAPL, ATTAPL)

## Usage Guidelines

1. **Algorithm Selection**: Choose between HM inference and bidirectional checking based on language features
2. **Constraint Generation**: Separate constraint generation from solving for cleaner implementation
3. **Error Localization**: Track constraint origins for accurate error location
4. **Variance**: Document variance rules explicitly for all generic positions
5. **Gradual Typing**: Consider gradual typing for mixed typed/untyped codebases

## Output Schema

```json
{
  "type": "object",
  "properties": {
    "inferenceAlgorithm": {
      "type": "string",
      "enum": ["hindley-milner", "bidirectional", "constraint-based", "flow-sensitive"]
    },
    "subtypingKind": {
      "type": "string",
      "enum": ["structural", "nominal", "mixed"]
    },
    "features": {
      "type": "array",
      "items": { "type": "string" }
    },
    "generatedFiles": {
      "type": "array",
      "items": { "type": "string" }
    }
  }
}
```

Related Skills

typescript

509
from a5c-ai/babysitter

TypeScript configuration, strict mode, generics, and type utilities.

prototype-interaction

509
from a5c-ai/babysitter

Define and document prototype interactions, transitions, and hotspots

typespec-sdk-generator

509
from a5c-ai/babysitter

Microsoft TypeSpec-based API and SDK generation

typescript-sdk-specialist

509
from a5c-ai/babysitter

TypeScript SDK development with Node.js and browser support. Design SDK architecture, implement type-safe API clients, support ESM and CommonJS modules, and configure bundling for browsers.

critical-theory-application

509
from a5c-ai/babysitter

Apply theoretical frameworks (postcolonial, feminist, Marxist, post-structuralist) to cultural texts and phenomena

type-inference-engine

509
from a5c-ai/babysitter

Implement and test type inference algorithms including Algorithm W and constraint-based inference

hpo-phenotype-matcher

509
from a5c-ai/babysitter

Human Phenotype Ontology skill for phenotype-driven gene prioritization

mcp-sdk-typescript-bootstrapper

509
from a5c-ai/babysitter

Bootstrap MCP (Model Context Protocol) servers with the official TypeScript SDK. Creates complete server implementations with transport layer, tools, resources, and proper error handling.

number-theory-toolkit

509
from a5c-ai/babysitter

Provide number theory algorithm implementations and guidance

process-builder

509
from a5c-ai/babysitter

Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.

Workflow & Productivity

babysitter

509
from a5c-ai/babysitter

Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)

yolo

509
from a5c-ai/babysitter

Run Babysitter autonomously with minimal manual interruption.