Abstract

Why a prompt needs a syntax.

We have quietly begun writing code in natural language. And yet the tools that make code code — a compiler, a linter, a type checker — are absent from the writing surface. Undefined variables. Ambiguous instructions. Hallucinations. In any serious programming language, every one of these is a syntax error. In prompt engineering, they are somehow treated as matters of taste.

This document is a language specification for prompts written to be executed. Its standardisation is the central concern of this Lab.

Undefined variables, ambiguous instructions, hallucinations.
Every one of them is a syntax error.

Philosophy

The Lab's position.

The specification is written from one position: prompt engineering is not a collection of magic spells or tips and tricks. It is a field of systematic engineering principles, and it is past time it was treated that way.

The aim is to establish prompt design as a serious practical discipline — one with reproducible and testable methods. The specification synthesises public guidance from OpenAI, Anthropic, and Google, together with patterns drawn from community practice, into a single structured standard.

Core Principles

Three principles.

  1. § 01 Markdown-Native Syntax Write prompts in Markdown. This has become the industry's de facto standard for a reason. Use headers (#), bullets (-), and code fences (```). Structured information is dramatically easier for an LLM to parse than paragraphs of undifferentiated prose.
  2. § 02 Principle of Explicitness Do not rely on implicit instructions. State everything. Name variables, define delimiters, number the steps. Do not expect the model to read between the lines. It will read between them — just not the lines you wrote.
  3. § 03 Reproducibility Write prompts that produce consistent results across independent executions. No "as I mentioned in the previous chat" — no outside references — unless you are deliberately managing context. A prompt that only works once is not a prompt; it is a happy accident.

Specification

What's in v0.3.0

Ten sections. Begins with the three core principles, passes through variable declaration, delimiters, and structured patterns, and ends with LLMOps, anti-patterns, and debugging.

§ 1. Core Principles Markdown-Native / Explicitness / Reproducibility — the three foundations
§ 2. Variable Declaration {variable_name}: + """ as the standard declaration form
§ 3. Delimiters Triple quotes / XML tags / YAML — where each belongs, and where it doesn't
§ 4. Global Standards Recommended patterns from OpenAI, Anthropic, and CO-STAR (Singapore GovTech)
§ 5. Structuring Patterns Role / Context / Goal / Constraints and five further structural elements
§ 6. Structured Reasoning SCoT, Chain of Verification (CoVe), Chain of Density (CoD)
§ 7. Prompt Chaining Multi-step prompts, context management, data-dependency tracking
§ 8. LLMOps Version control, observability, evaluation, governance
§ 9. Anti-patterns The taxonomy of how prompts go wrong — and how to stop writing them that way
§ 10. Debugging Glass-box techniques, variable inspection, an error-isolation checklist

§ 2 — Variable Declaration

# ✅ Recommended

{target_audience}:
"""
Mid-level Sales Professional
Annual Income: $80,000
Location: New York City
"""

{pain_points}:
"""
Struggling with public speaking in English
Handling international negotiations
"""

# ❌ Avoid — headers are not variables
# Target Audience
# Mid-level Sales Professional

§ 6 — Chain of Verification (CoVe)

# Verified Answer Generation

[C1] Draft
Generate initial answer to {question}.

[C2] Plan Verification
Identify claims in {draft}
needing fact-checking.

[C3] Execute
Answer {verification_questions}
using external knowledge.

[C4] Revise
Based on {verification_results},
produce {final_answer}.

Meta

Version v0.3.0 — pre-release (v1.0.0 to follow community adoption)
Last updated 2025-12-04
Authoritative version English (STANDARDS.md). The Japanese version is a community translation.
Original editor Takaho Hatanaka (2024)
Synthesised from OpenAI / Anthropic / Google public guidance + community practice via LangChain
Repository github.com/taka4rest/prompt-as-code
Spec document STANDARDS.md

Read it. Argue with it. Improve it.

The specification is run as a living standard. Anyone can contribute — through GitHub Issues or pull requests — a new anti-pattern observed in the wild, a new structuring pattern worth naming, a sharper example, or a translation. The point is the standard, not the editor.