prompt-calculus

Formalize and analyze LLM prompt behavior with a probabilistic evaluation kernel.

12|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/jbrukh/skills --skill prompt-calculus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-calculus
Source: https://github.com/jbrukh/skills/tree/main/skills/prompt-calculus
Command: npx skills add https://github.com/jbrukh/skills --skill prompt-calculus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This formalism provides a compact framework to reason about LLM prompts, their evaluation semantics, and how prompt functions compose and affect outputs.

Core Features & Use Cases

  • Evaluation kernel and context modeling: defines how prompts map to output distributions and how context modifies evaluation.
  • Prompt functions and composition: formalizes applying prompts as functions and composing them (G ∘ F) to build complex behaviors.
  • Iterated self-application and fixed points: explains how prompts can be applied repeatedly, convergence properties, and quines.

Quick Start

Apply a simple prompt function to a sample input and trace the resulting output distribution using the evaluation kernel.

Frequently Asked Questions about prompt-calculus

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I formally model LLM prompt evaluation semantics and output distributions?

You can model LLM prompt evaluation using a probabilistic evaluation kernel that maps prompts to output distributions, allowing you to analyze predictability and context-dependent behavior.

How does prompt composition work when chaining multiple LLM prompts together?

Prompt composition formalizes applying prompts as functions and combining them (G ∘ F) to build complex behaviors, using rules like the Chapman–Kolmogorov equation for evaluation.

Can I analyze what happens when an LLM prompt is applied iteratively to its own output?

Iterated self-application is analyzed by evaluating convergence properties and fixed points, explaining how repeatedly applying a prompt stabilizes outputs or generates quines.

What is a probability kernel in the context of LLM prompt structure analysis?

A probability kernel defines how prompts map to output distributions and how context modifies evaluation, serving as the core mechanism for reasoning about prompt behavior.

How do I predict output stability across different contexts for a specific LLM prompt?

Output predictability across contexts is evaluated by applying the distributional kernel K with varying contexts and information predicates to trace how output distributions change.

Do I need specific frameworks to use the Chapman-Kolmogorov equation for prompt composition?

No external frameworks are needed; the formalism defines its own structure including a distributional kernel K, contexts, information predicates, and the Chapman–Kolmogorov composition rule.