articlelang
v0.3.0
Published
Composable Storytelling Language (CSL) - a DSL for article/story specifications
Downloads
516
Maintainers
Readme
ArticleLang - Composable Storytelling Language (CSL)
A domain-specific language for writing article and story specifications. Compose narrative structures and constraints, and the system compiles them into prompts and generated prose.
Pipeline
.csl source -> Lexer -> Parser -> AST -> Validator -> Narrative IR -> Prompt Compiler -> Provider -> OutputInstall
npm install articlelangUsage
# Parse a CSL file into AST
csl parse examples/essay_ai_architecture.csl
# Validate a CSL file
csl validate examples/essay_ai_architecture.csl
# Compile to prompt payload
csl compile examples/essay_ai_architecture.csl
# Render to prose (uses mock provider by default)
csl render examples/essay_ai_architecture.csl --target blog
# Lint generated output against constraints
csl lint examples/essay_ai_architecture.cslExample
article "Why AI Agents Will Replace Microservices" {
thesis: "Agent-based architectures will supersede microservice patterns"
goal: persuade
audience: "Senior software engineers"
tone: provocative
use contrarian_intro
use progressive_argument
contrarian_intro {
claim: "Microservices solved distributed computing"
reframe: "But agents solve it better"
}
progressive_argument {
points: [
"Agents internalize routing logic",
"State becomes agent-scoped",
"Deployment collapses to a single artifact"
]
}
constraints {
min_words: 1500
max_words: 2500
no_lists: true
}
}Try it Online
ArticleLang Studio is a browser-based editor for CSL with Monaco, live validation, pipeline inspection, and LLM rendering.
Docs
Development
npm test # run tests
npm run build # compile TypeScript
npm run lint # type-check without emitAuthor
Pelayo Mendez — GitHub
License
MIT
