dean0x

Mdscript — AI skill for Claude Code

AI community

A template language for composable LLM prompt engineering.

How to install Mdscript

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

What Mdscript does

A template language for composable LLM prompt engineering. Write prompts with variables, loops, conditionals, functions, and imports, then compile to clean Markdown.

Alternatives in AI

  • ARIS Agent Guide — For AI agents reading this repo 6.2k ★
  • Agent Rules Books — AGENTS.md rules / skills for AI coding agents: Codex, Cursor & Claude Code 2.6k ★
  • Auto Re Agent — Open-source AI reverse-engineering agent using Ghidra and LLMs to reconstruct and validate C/C++ functions fro 1.4k ★

README

MDS - Markdown Script

[![CI](https://github.com/dean0x/mdscript/actions/workflows/ci.yml/badge.svg)](https://github.com/dean0x/mdscript/actions/workflows/ci.yml) [![crates.io](https://img.shields.io/crates/v/mds-cli.svg)](https://crates.io/crates/mds-cli) [![npm](https://img.shields.io/npm/v/@mdscript/mds.svg)](https://www.npmjs.com/package/@mdscript/mds) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

LLM prompts grow into copy-pasted walls of text that drift across agents, models, and environments. MDS gives you variables, functions, imports, and conditionals so you can write prompts once and compose them everywhere, compiled to clean Markdown.

Built for AI engineers who manage prompt libraries across agents, models, and environments.

Quick Start

**Install the CLI** (Rust):

cargo install mds-cli

**Or install via npm** (Node or browser):

npm install @mdscript/mds

**Create and compile a starter template**:

mds init                       # creates hello.mds
mds build hello.mds            # compiles to hello.md
mds build hello.mds -o -       # stdout

**For multi-file prompt libraries**, templates compose via `@import` — for example:

---
model: claude-sonnet
tools: [search, calculator]
---

@import "./safety.mds" as guard
@import "./personas.mds" as persona

{{persona.code_reviewer("TypeScript")}}

{{guard.safety_rules()}}

## Available Tools

@for tool in tools:
- **{{tool}}**
@end

@if model == "claude-sonnet":
Use extended thinking for complex tasks.
@end

See [`examples/prompt-library/`](examples/prompt-library/) for a complete reusable prompt library using `@export`/`@import` (personas, formatting, guardrails). If imports from cross-directory libraries are rejected with a containment error, see [Project root](#project-root).

Unlike general-purpose template engines, MDS is Markdown-native: no delimiters to escape, no runtime to configure. The compiler catches undefined varia