Stim banner
wess wess

Stim

Documentation community

Description

Basically a DSL that make writing Claude Code commands more "code" and less Markdown...

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Stim

**A DSL for writing AI prompts — commands, agents, and rules — that compiles to whatever tool you use.**

Write one `.stim` file. Target Claude Code, ChatGPT, Cursor, or any future AI tool by switching a flag.

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


Why Stim?

AI prompts have become software. Slash commands, system prompts, agent definitions, rule files — they're all code now, but most of us write them as raw markdown that breaks the moment the logic gets complex or the tool changes. Stim treats prompts as source code: parse, validate, compile.

**Three declarators, three targets:**

command deploy {
  ask("Which environment?")
  wait_for_response()
  for service in services {
    task bash "deploy " + service { ... }
  }
}
agent reviewer {
  description "Reviews PRs for security and correctness"
  tools [Read, Grep, Bash]
  model "sonnet"

  "You are a senior code reviewer. Cite specific files and line numbers."
  "Prioritize by severity: must change, should change, could improve."
}

One source, many outputs:

stim install reviewer.stim                   # → ~/.claude/agents/reviewer.md
stim install reviewer.stim --target cursor   # → .cursor/rules/reviewer.mdc
stim compile reviewer.stim --target chatgpt  # → dist/chatgpt/reviewer.md

What You Get

  • Three declaratorscommand for interactive slash commands, agent for system prompts with metadata, harness for reusable orchestration templates
  • Three targetsclaude, chatgpt, cursor (more to come; targets are pluggable adapters)
  • Real control flowif/else, while, for, break
  • Orchestration — bounded agentic loops, dynamic fanout/gather, content routeing, and parameterized harnesses you run
  • Variables and imports — strings, booleans, arrays; share definitions across files
  • Subagent tasks — spawn bash, explore, plan, or `gene