# Kleisli.IO Documentation > Documentation for the Kleisli.IO platform. > Includes project guides, API references, and architecture docs. ## MCP Server An MCP (Model Context Protocol) server is available for programmatic access: - Endpoint: https://docs.kleisli.io/mcp - Transport: Streamable HTTP (POST) - Tools: search_docs(query), get_page(project,section,page), list_projects() - Resources: docs://kleisli/{project}/{section}/{page} ## kli Task graphs and pattern playbooks for Claude Code. ### Getting Started - [Configuration](https://docs.kleisli.io/kli/getting-started/configuration): What kli init Sets Up Running kli init in your project configures five things: MCP server — Claude gets access to... - [Installation](https://docs.kleisli.io/kli/getting-started/installation): Prerequisites Claude Code — Anthropic's CLI for Claude (install guide) Nix is not required to use kli. Pre-built... - [Quick Start](https://docs.kleisli.io/kli/getting-started/quick-start): kli extends Claude Code with structured workflows for software engineering. You interact with kli through slash... ### Using kli - [Understanding Patterns](https://docs.kleisli.io/kli/using-kli/understanding-patterns): The playbook is kli's long-term memory — a collection of patterns learned from previous work. Patterns capture what... - [Workflow Overview](https://docs.kleisli.io/kli/using-kli/workflow-overview): kli structures work into four phases: research, plan, implement, and reflect. You move through these phases by typing... - [Working with Tasks](https://docs.kleisli.io/kli/using-kli/working-with-tasks): Tasks are how kli tracks work across sessions. A task is a directory with an append-only event log that records... ### Command Reference - [Commit](https://docs.kleisli.io/kli/commands/commit): Commit changes with auto-generated conventional commit messages Intelligently commit changes with auto-generated... - [Create Task](https://docs.kleisli.io/kli/commands/create-task): Scaffold a task with event-sourced tracking via the task MCP server Scaffold an event-sourced task with the task MCP... - [Handoff](https://docs.kleisli.io/kli/commands/handoff): Create handoff document for transferring work to another session You are tasked with writing a handoff document to... - [Implement](https://docs.kleisli.io/kli/commands/implement): Implement approved plan phase-by-phase with TDD workflow and verification gates Execute phased implementation plans... - [Iterate Plan](https://docs.kleisli.io/kli/commands/iterate_plan): Iterate on existing implementation plans with thorough research and updates You are tasked with updating existing... - [Plan](https://docs.kleisli.io/kli/commands/plan): Create detailed implementation plans through iterative planning with artifact reuse Create detailed, phased... - [Reflect](https://docs.kleisli.io/kli/commands/reflect): Reflect on completed task and evolve playbooks Extract learnings from completed tasks by orchestrating the reflector... - [Research](https://docs.kleisli.io/kli/commands/research): Document codebase as-is through iterative research with observation capture Research the codebase or external topics... - [Resume Handoff](https://docs.kleisli.io/kli/commands/resume_handoff): Resume work from handoff document with context analysis and validation You are tasked with resuming work from a... - [Resume Task](https://docs.kleisli.io/kli/commands/resume-task): Resume work on a task by gathering context from event stream and graph state Resume work on a task by gathering... - [Validate](https://docs.kleisli.io/kli/commands/validate): Validate implementation against plan, verify success criteria, identify issues You are tasked with validating that an... ### Workflow Reference - [Implementation](https://docs.kleisli.io/kli/workflows/implementation): Implementation phase domain knowledge including TDD methodology, design principles... - [Planning](https://docs.kleisli.io/kli/workflows/planning): Planning phase domain knowledge including phase design principles, artifact reuse patterns, and verification... - [Reflection](https://docs.kleisli.io/kli/workflows/reflection): Reflection phase domain knowledge including pattern evaluation, observation analysis, and evidence-based learning. Use... - [Research](https://docs.kleisli.io/kli/workflows/research): Research phase domain knowledge including documentarian philosophy, decomposition patterns, agent selection, and exit... - [Team](https://docs.kleisli.io/kli/workflows/team): Team coordination domain knowledge for bridging Claude Code teams with the persistent task graph and observation... - [Using-cli](https://docs.kleisli.io/kli/workflows/using-cli): Use the kli CLI to interact with task graphs via Bash when MCP tools are unavailable. Teaches kli --task syntax for... - [Workflow](https://docs.kleisli.io/kli/workflows/workflow): Meta-orchestration skill for KLI framework. Provides high-level overview of research/planning/implementation/reflection... ### Agent Reference - [Codebase Analyzer](https://docs.kleisli.io/kli/agents/codebase-analyzer): Analyzes codebase implementation details for specific components. Input{files_to_analyze,analysis_focus}. Refuses... - [Codebase Locator](https://docs.kleisli.io/kli/agents/codebase-locator): Locates files, directories, and components. Use as "super grep" for multi-search. Input{query,scope?}.... - [Curator](https://docs.kleisli.io/kli/agents/curator): Updates playbooks from reflection artifacts. Input{task_dir,reflection_path}. Refuses without both. Available... - [Graph Analyst](https://docs.kleisli.io/kli/agents/graph-analyst): Answers questions from the task/pattern graph perspective. Use when question relates to task status, patterns,... - [Pattern Finder](https://docs.kleisli.io/kli/agents/pattern-finder): Finds similar patterns and examples in codebase. Input{pattern_description,scope?}. Refuses without... - [Reflector](https://docs.kleisli.io/kli/agents/reflector): Produces reflection artifacts with pattern evaluation and discovery. Input{task_dir,task_id,context}. Refuses without... ### Hooks Reference - [Feedback Nudge](https://docs.kleisli.io/kli/hooks/feedback-nudge): Stop hook handler for pattern feedback reminders Event: Stop Reminds agents to give feedback on activated playbook... - [File Conflict](https://docs.kleisli.io/kli/hooks/file-conflict): PostToolUse hook handler for swarm file conflict detection Event: PostToolUse Matches: Edit|Write Warns Claude after... - [Playbook Activate](https://docs.kleisli.io/kli/hooks/playbook-activate): UserPromptSubmit hook handler Event: UserPromptSubmit Lightweight domain detection + nudge. Detects programming... - [Session Leave](https://docs.kleisli.io/kli/hooks/session-leave): SessionEnd hook handler Event: SessionEnd Best-effort: SessionEnd fires non-deterministically (cleanup-on-start in... - [Session Start](https://docs.kleisli.io/kli/hooks/session-start): SessionStart hook handler Event: SessionStart What It Does Stale PID cleanup (primary SessionEnd... - [Session Task Write](https://docs.kleisli.io/kli/hooks/session-task-write): PostToolUse hook handler for session file writes Event: PostToolUse Matches:... - [Task Complete Reflect](https://docs.kleisli.io/kli/hooks/task-complete-reflect): PostToolUse hook for auto-reflection nudge Event: PostToolUse Matches: mcp__task__task_complete Fires after... - [Tool Call](https://docs.kleisli.io/kli/hooks/tool-call): PostToolUse hook handler for tool tracking Event: PostToolUse Matches:... ### Reference - [Architecture](https://docs.kleisli.io/kli/reference/architecture): kli is a single Common Lisp binary built with SBCL. One process handles the MCP server, hook dispatch, the dashboard,... ## nix-effects A type-checking kernel, algebraic effects, and dependent types in pure Nix. ### Guide - [Introduction](https://docs.kleisli.io/nix-effects/guide/introduction): Nix configurations fail late. A misspelled option name, a string where an integer belongs, a firewall rule that... - [Getting Started](https://docs.kleisli.io/nix-effects/guide/getting-started): Installation Add nix-effects as a flake input: { inputs.nix-effects.url = "github:kleisli-io/nix-effects"; ... - [Proof Guide](https://docs.kleisli.io/nix-effects/guide/proof-guide): Nix configurations are concrete at eval time. Every field, every value, every list element is known before anything... - [Theory](https://docs.kleisli.io/nix-effects/guide/theory): Nine papers shaped nix-effects. Here's how each one maps to code. Algebraic effects and the freer monad A computation... - [Trampoline](https://docs.kleisli.io/nix-effects/guide/trampoline): The trampoline is how nix-effects interprets freer monad computations with O(1) stack depth in a language with no... - [Systems Architecture](https://docs.kleisli.io/nix-effects/guide/systems-architecture): nix-effects grounds all types in a small, trusted type-checking kernel — a Lean-light MLTT core running entirely at nix... - [Kernel Architecture](https://docs.kleisli.io/nix-effects/guide/kernel-architecture): This chapter describes the type-checking kernel: its pipeline, its primitives, and how to write verified... - [Kernel Formal Specification](https://docs.kleisli.io/nix-effects/guide/kernel-spec): This document is the contract the implementation must satisfy. Every typing rule, compute rule, and conversion rule is... ### Core API - [Adapt](https://docs.kleisli.io/nix-effects/core-api/adapt): Handler context transformation. Contravariant on context, covariant on continuation. adapt Transform a handler's... - [Kernel](https://docs.kleisli.io/nix-effects/core-api/kernel): Freer monad kernel: Return/OpCall ADT with FTCQueue bind, send, map, seq. bind Monadic bind: sequence two... - [Queue](https://docs.kleisli.io/nix-effects/core-api/queue): FTCQueue (catenable queue, after Kiselyov & Ishii 2015). O(1) snoc/append, amortized O(1)... - [Trampoline](https://docs.kleisli.io/nix-effects/core-api/trampoline): Trampolined interpreter using builtins.genericClosure for O(1) stack depth. handle Trampolined handler combinator... ### Effects - [Acc](https://docs.kleisli.io/nix-effects/effects/acc): Accumulator effect: emit/emitAll/collect for incremental list building. collect Read the current accumulated... - [Choice](https://docs.kleisli.io/nix-effects/effects/choice): Non-deterministic choice effect: choose/fail/guard with list handler. choose Non-deterministic choice from a list of... - [Conditions](https://docs.kleisli.io/nix-effects/effects/conditions): CL-style condition system: signal/warn with restart-based recovery. collectConditions Collecting handler: accumulates... - [Error](https://docs.kleisli.io/nix-effects/effects/error): Error effect with contextual messages and multiple handler strategies. collecting Collecting error handler:... - [Linear](https://docs.kleisli.io/nix-effects/effects/linear): Graded linear resource tracking: acquire/consume/release with usage enforcement. Each resource gets a capability token... - [Reader](https://docs.kleisli.io/nix-effects/effects/reader): Read-only environment effect: ask/asks/local with standard handler. ask Read the current environment. ask :... - [State](https://docs.kleisli.io/nix-effects/effects/state): Mutable state effect: get/put/modify with standard handler. get Read the current state. Returns a Computation that,... - [Typecheck](https://docs.kleisli.io/nix-effects/effects/typecheck): Reusable typeCheck handlers: strict (throw), collecting (accumulate), logging (record all). collecting Collecting... - [Writer](https://docs.kleisli.io/nix-effects/effects/writer): Append-only output effect: tell/tellAll with list-collecting handler. handler Standard writer handler. Collects tell... ### Types - [Constructors](https://docs.kleisli.io/nix-effects/types/constructors): Type constructors: Record, ListOf, Maybe, Either, Variant. Either Tagged union of two types. Accepts { _tag =... - [Dependent](https://docs.kleisli.io/nix-effects/types/dependent): Dependent contracts: Pi (Π), Sigma (Σ), Certified, Vector, DepRecord. Grounded in Martin-Löf (1984)... - [Foundation](https://docs.kleisli.io/nix-effects/types/foundation): Type system foundation: Type constructor, check, validate, make, refine. check Check whether a value inhabits a type.... - [Linear](https://docs.kleisli.io/nix-effects/types/linear): Linear type constructors: structural guards for capability tokens. Pure type predicates that check token structure... - [Primitives](https://docs.kleisli.io/nix-effects/types/primitives): Primitive types: String, Int, Bool, Float, Attrs, Path, Function, Null, Unit, Any. Any Top type. Every value inhabits... - [Refinement](https://docs.kleisli.io/nix-effects/types/refinement): Refinement types and predicate combinators. Grounded in Freeman & Pfenning (1991) and Rondon et al.... - [Universe](https://docs.kleisli.io/nix-effects/types/universe): Universe hierarchy: Type_0 : Type_1 : Type_2 : ... Lazy infinite tower. level Get the universe level of a... ### Streams - [Combine](https://docs.kleisli.io/nix-effects/streams/combine): Stream combination: concat, interleave, zip, zipWith. concat Concatenate two streams: all elements of the first, then... - [Core](https://docs.kleisli.io/nix-effects/streams/core): Stream primitives: done/more/fromList/iterate/range/replicate. done Terminate a stream with a final value. done : a... - [Limit](https://docs.kleisli.io/nix-effects/streams/limit): Stream limiting: take, takeWhile, drop. drop Skip the first n elements of a stream. drop : int -> Computation... - [Reduce](https://docs.kleisli.io/nix-effects/streams/reduce): Stream reduction: fold, toList, length, sum, any, all. all Check if all elements satisfy a predicate. all : (a ->... - [Transform](https://docs.kleisli.io/nix-effects/streams/transform): Stream transformations: map, filter, scanl. filter Keep only elements satisfying a predicate. sfilter : (a ->... ### Type Checker - [Check](https://docs.kleisli.io/nix-effects/type-checker/check): Semi-trusted (Layer 1): uses the TCB (eval/quote/conv) and reports type errors via send "typeError". Bugs... - [Conv](https://docs.kleisli.io/nix-effects/type-checker/conv): Checks whether two values are definitionally equal at a given binding depth. Purely structural — no type information... - [Elaborate](https://docs.kleisli.io/nix-effects/type-checker/elaborate): Bridges the fx.types layer to the kernel's term representation via the HOAS combinator layer. Provides the Nix ↔ kernel... - [Eval](https://docs.kleisli.io/nix-effects/type-checker/eval): Pure evaluator: interprets kernel terms in an environment of values. Zero effect system imports — part of the trusted... - [Hoas](https://docs.kleisli.io/nix-effects/type-checker/hoas): Higher-Order Abstract Syntax layer that lets you write kernel terms using Nix lambdas for variable binding. The... - [Quote](https://docs.kleisli.io/nix-effects/type-checker/quote): Converts values back to terms, translating de Bruijn levels to indices. Pure function — part of the TCB. Spec... - [Term](https://docs.kleisli.io/nix-effects/type-checker/term): Syntax of the kernel's term language. All 48 constructors produce attrsets with a tag field (not _tag, to distinguish... - [Value](https://docs.kleisli.io/nix-effects/type-checker/value): Values are the semantic domain produced by evaluation. They use de Bruijn levels (counting outward from the top of the... - [Verified](https://docs.kleisli.io/nix-effects/type-checker/verified): High-level combinators for writing kernel-checked implementations. Write programs with these combinators, then call...