Skip to main content
Glama
README.md
<p align="center">
  <img src="https://raw.githubusercontent.com/rafliiar17/markforge/main/packages/web/public/banner.png" alt="MarkForge Banner" width="100%" onerror="this.style.display='none'"/>
</p>

<h1 align="center">โšก MarkForge</h1>

<p align="center">
  <strong>Universal Markdown to Document (PDF & OpenXML DOCX) Compiler with ATS Optimization, Developer CLI, Web Studio, and Model Context Protocol (MCP) Server.</strong>
</p>

<p align="center">
  <a href="https://github.com/rafliiar17/markforge/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License" /></a>
  <a href="https://bun.sh"><img src="https://img.shields.io/badge/runtime-Bun%201.4-fbf0df.svg" alt="Bun 1.4" /></a>
  <a href="https://nextjs.org"><img src="https://img.shields.io/badge/web-Next.js%2015-black.svg" alt="Next.js 15" /></a>
  <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/protocol-MCP%20Ready-7c3aed.svg" alt="MCP Ready" /></a>
  <a href="https://ui.shadcn.com"><img src="https://img.shields.io/badge/ui-shadcn%2Fui-000000.svg" alt="shadcn/ui" /></a>
  <a href="https://mark.arafz.id"><img src="https://img.shields.io/badge/deployed-mark.arafz.id-f38020.svg?logo=cloudflare" alt="Cloudflare Edge" /></a>
  <a href="https://github.com/rafliiar17/markforge/actions"><img src="https://img.shields.io/badge/CI-passing-emerald.svg" alt="CI Status" /></a>
  <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/typescript-strict-3178c6.svg" alt="TypeScript Strict" /></a>
</p>

---

## ๐Ÿ“‘ Table of Contents
- [๐ŸŒŸ Why MarkForge?](#-why-markforge)
- [โœจ Key Features](#-key-features)
- [๐Ÿ—๏ธ System Architecture](#๏ธ-system-architecture)
- [๐ŸŽจ Document Templates & Presets](#-document-templates--presets)
- [๐Ÿš€ Quickstart](#-quickstart)
  - [1. Developer CLI](#1-developer-cli)
  - [2. Interactive Web Studio](#2-interactive-web-studio)
  - [3. Docker Container](#3-docker-container)
- [๐Ÿค– Model Context Protocol (MCP) Setup](#-model-context-protocol-mcp-setup)
- [๐Ÿ“– Deep Documentation](#-deep-documentation)
- [๐Ÿ“ฆ Monorepo Topology](#-monorepo-topology)
- [๐Ÿงช Quality Gates & Testing](#-quality-gates--testing)
- [๐Ÿค Contributing & Community](#-contributing--community)
- [๐Ÿ“„ License & Author](#-license--author)

---

## ๐ŸŒŸ Why MarkForge?

Writing documents in Markdown is frictionless, but converting them into corporate-ready formats is notoriously painful:
- Pandoc often strips formatting nuances or requires complex LaTeX toolchains.
- Manual word processor exports lead to broken margins, inconsistent fonts, and mangled tables.
- Standard resume templates trigger parsing failures in legacy Applicant Tracking Systems (ATS).

**MarkForge** bridges this gap:
1. **1:1 Visual Parity**: Generates native OpenXML (`.docx`) and print-quality PDF files that share identical typography, margins, and section spacing.
2. **Built-in ATS & Quality Auditor**: Evaluates your markdown AST against recruitment criteria (scores 0-100, action verb density, quantifiable metrics, section completeness).
3. **AI-Native via MCP**: Enables LLMs (Claude Desktop, Cursor, Antigravity) to directly compile, audit, and optimize documents without leaving chat.
4. **Developer-First DX**: Watch mode for instantaneous recompilation, debounced AST evaluation, and structured Pino/OpenTelemetry observability.

---

## โœจ Key Features

- ๐Ÿ“„ **Universal Output**: Compile to OpenXML (`.docx`), Headless PDF (via LibreOffice or WeasyPrint), Pure HTML5 with Print CSS, or both simultaneously.
- ๐ŸŽฏ **ATS Optimization Engine**: AST-based parser that calculates ATS parseability, flags missing sections, counts high-impact action verbs (EN/ID), and highlights quantifiable metrics.
- ๐ŸŽจ **5 Curated Document Presets**:
  - `ats-classic`: Minimalist, zero graphics, 100% parseable by legacy and modern Applicant Tracking Systems.
  - `modern-accent`: Contemporary emerald accents, refined headers, and crisp dividers.
  - `tech-spec`: Engineered for RFCs, architectural blueprints, tables, and code snippets.
  - `academic`: Formal serif typography, numbered sections, and standard 1-inch margins.
  - `executive`: Polished serif headers with bronze accents for leadership profiles.
- ๐Ÿ“Š **Native Mermaid Flowcharts**: Transpile ````mermaid```` code blocks into scalable vector SVG diagrams in Web Studio and high-fidelity representations in exports.
- ๐ŸŒ **Type-Safe Dual-Language Support**: Complete bilingual interface (Bahasa Indonesia `id` and English `en`) across Web Studio, error messages, and starter templates.
- ๐Ÿ–ฅ๏ธ **Next.js 15 Web Studio**: Split-screen live editor, simulated A4 preview canvas, dashed page-break guides, browser print fallback, and official **shadcn/ui** components.
- ๐Ÿ”Œ **Official MCP Server**: Turn Claude Desktop, Cursor IDE, or Antigravity into your document compiler and ATS editor over standard I/O (`stdio`).

---

## ๐Ÿ—๏ธ System Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Markdown Input (.md)                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   MarkForge Core Engine                     โ”‚
โ”‚  - AST Parser & Inline Tokenizer                            โ”‚
โ”‚  - ATS & Quality Analyzer (Scores, Verbs, Metrics)         โ”‚
โ”‚  - Template Registry (ATS Classic, Modern, Tech Spec...)    โ”‚
โ”‚  - Structured Pino Logger & OpenTelemetry Spans             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚                โ”‚                 โ”‚
               โ–ผ                โ–ผ                 โ–ผ
      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
      โ”‚  OpenXML DOCX  โ”‚ โ”‚  Pure HTML5  โ”‚ โ”‚ Headless PDF  โ”‚
      โ”‚   (docx-js)    โ”‚ โ”‚ (Print CSS)  โ”‚ โ”‚ (LibreOffice) โ”‚
      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ–ฒ                โ–ฒ                 โ–ฒ
               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚                                               โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ CLI DX  โ”‚                                    โ”‚  Web UI   โ”‚
   โ”‚ (bun)   โ”‚                                    โ”‚ (Next.js) โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                        โ–ฒ
                                                        โ”‚
                                                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                                 โ”‚ MCP Server  โ”‚
                                                 โ”‚ (Claude/AI) โ”‚
                                                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

> ๐Ÿ“– *For in-depth compiler pipeline specifications, read [System Architecture](docs/architecture.md).*

---

## ๐ŸŽจ Document Templates & Presets

| Template | Primary Font | Accent | Best For | ATS Compatibility |
|---|---|---|---|:---:|
| `ats-classic` | Arial / Helvetica | Charcoal | Standard Resumes, Applications | โญ๏ธโญ๏ธโญ๏ธโญ๏ธโญ๏ธ (100%) |
| `modern-accent` | Inter / Calibri | Emerald | Tech Portfolios, Modern CVs | โญ๏ธโญ๏ธโญ๏ธโญ๏ธ (95%) |
| `tech-spec` | JetBrains Mono / Arial | Indigo | Architecture RFCs, Technical Specs | โญ๏ธโญ๏ธโญ๏ธโญ๏ธ (N/A) |
| `academic` | Times New Roman | Slate | Research Proposals, Theses | โญ๏ธโญ๏ธโญ๏ธโญ๏ธ (90%) |
| `executive` | Garamond | Bronze | Senior Leadership Biographies | โญ๏ธโญ๏ธโญ๏ธโญ๏ธ (92%) |

### ๐Ÿ“ Production Mermaid Architecture Templates
MarkForge natively renders enterprise-grade Mermaid diagrams with automatic template-synchronized palette theming, live SVG generation, and clean fallback warnings:
- **Cloud Microservices & Zero-Trust Ingress** (`cloud-microservices`): Cloudflare CDN/WAF, Envoy Gateway, JWT verification, microservices mesh, Kafka, PostgreSQL HA, Redis, OTel tracing.
- **Event-Driven CQRS & Real-Time Ingestion** (`event-driven-cqrs`): Partitioned Kafka buffer, stream workers, append-only event store, resilient Dead Letter Queue (DLQ), and query projection search views.
- **Clean Hexagonal Architecture** (`hexagonal-architecture`): Domain-Driven Design (DDD) with Driving Adapters, Application Use Cases, Core Domain, and Driven Infrastructure Ports.
- **Zero-Trust Enterprise Security** (`zero-trust-security`): IdP auth, Edge Policy Enforcement Points (PEP), Open Policy Agent (OPA) engine, SPIFFE mTLS workload mesh, and immutable WORM audit trails.
- **Multi-Region High-Availability & Disaster Recovery** (`multi-region-resilience`): Anycast Geo-DNS, active Kubernetes compute pods, warm standby region, and cross-region asynchronous database WAL replication.
- **Production Lifecycle & Decision Logic** (`standard-flowchart`): Standard production engineering workflow with AST validation checkpoints and error recovery paths.

> ๐Ÿ“– *For complete template catalogs, read [Templates & Architecture Guide](docs/templates.md).*

---

## ๐Ÿš€ Quickstart

### 1. Developer CLI

Run directly with `bun` or `npx`:

```bash
# Compile markdown into both DOCX & PDF
bun run packages/cli/src/index.ts build resume.md --template ats-classic --format both

# Watch mode for real-time live compilation while editing
bun run packages/cli/src/index.ts watch resume.md --template modern-accent

# Run ATS & document quality audit
bun run packages/cli/src/index.ts analyze resume.md

# Enforce minimum ATS score threshold in CI (exit code 1 if < 85)
bun run packages/cli/src/index.ts analyze resume.md --min-score 85 --json

# Preview formatted markdown directly in terminal via native Bun.markdown
bun run packages/cli/src/index.ts preview resume.md

# Verify local rendering engines
bun run packages/cli/src/index.ts doctor
```

> ๐Ÿ“– *For complete command parameters and flags, read [CLI Documentation](docs/cli.md).*

---

### 2. Interactive Web Studio

๐ŸŒ **Live Edge Deployment**: [https://mark.arafz.id](https://mark.arafz.id) *(Global Next.js 15 deployment on Cloudflare Workers)*

Or launch the split-screen web studio locally:

```bash
# Clone the repository
git clone https://github.com/rafliiar17/markforge.git
cd markforge

# Install dependencies
bun install

# Start Next.js development server
bun dev:web
```

Open `http://localhost:3030` to access the studio.

---

### 3. Docker Container

Deploy the complete environment (including pre-configured LibreOffice, WeasyPrint, and Web Studio) in an isolated container:

```bash
docker-compose up --build
```

Access the studio at `http://localhost:3030`.

---

## ๐Ÿค– Model Context Protocol (MCP) Setup

Turn your AI assistant into an autonomous document compiler and resume coach.

### Claude Desktop (`claude_desktop_config.json`):
```json
{
  "mcpServers": {
    "markforge": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/markforge/packages/mcp/src/index.ts"]
    }
  }
}
```

### Cursor IDE (`.cursor/mcp.json`):
```json
{
  "mcpServers": {
    "markforge": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/markforge/packages/mcp/src/index.ts"]
    }
  }
}
```

### Available MCP Tools:
| Tool | Description |
|---|---|
| `convert_markdown` | Compiles markdown text to DOCX, PDF, or HTML with chosen styling |
| `analyze_document` | Audits ATS score, action verbs, quantified metrics, and missing sections |
| `list_templates` | Returns metadata, typography specs, and categories for all templates |
| `get_template_skeleton` | Returns starter markdown templates (ATS Resume, Tech Spec, etc.) |
| `doctor` | Verifies system conversion engines (LibreOffice, WeasyPrint, Pandoc) |

> ๐Ÿ“– *For complete MCP setup guides and sample AI prompts, read [MCP Documentation](docs/mcp.md).*

---

## ๐Ÿ“– Deep Documentation

Explore our comprehensive technical guides:
- [๐Ÿ› Architecture & Compiler Pipelines](docs/architecture.md)
- [๐Ÿ’ป CLI Command Manual & Flags](docs/cli.md)
- [๐Ÿค– Model Context Protocol (MCP) Integration](docs/mcp.md)
- [๐ŸŽจ Templates & Dynamic Document Types](docs/templates.md)
- [๐ŸŒ Internationalization (i18n) Architecture](docs/i18n.md)
- [๐Ÿ“ Markdown Syntax Reference & Cheatsheet](docs/MARKDOWN_CHEATSHEET.md)

---

## ๐Ÿ“ฆ Monorepo Topology

```
markforge/
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ core/      # AST parser, DOCX & PDF compilers, ATS analyzer, Pino logger
โ”‚   โ”œโ”€โ”€ cli/       # Developer CLI (`markforge build`, `watch`, `analyze`, `doctor`)
โ”‚   โ”œโ”€โ”€ mcp/       # Model Context Protocol (MCP) server for Claude / Cursor / AI
โ”‚   โ””โ”€โ”€ web/       # Next.js 15 App Router studio with Tailwind & shadcn/ui
โ”œโ”€โ”€ docs/          # Deep technical documentation
โ”œโ”€โ”€ examples/      # Sample ATS resumes, technical specifications, and portfolios
โ””โ”€โ”€ .github/       # CI/CD workflows, issue templates, PR template
```

---

## ๐Ÿงช Quality Gates & Testing

MarkForge maintains a 100% automated test pass rate across all packages:

```bash
# Run 112 automated unit and E2E tests
bun test

# Typecheck all packages with strict TypeScript
bun --cwd packages/core tsc --noEmit
bun --cwd packages/cli tsc --noEmit
bun --cwd packages/mcp tsc --noEmit
bun --cwd packages/web tsc --noEmit

# Test production Web Studio build
bun run --cwd packages/web build
```

---

## ๐Ÿค Contributing & Community

Contributions are warmly welcome! Please review:
- [Contributing Guidelines](CONTRIBUTING.md)
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Security Policy](SECURITY.md)
- [Changelog](CHANGELOG.md)

---

## ๐Ÿ“„ License & Author

Distributed under the [MIT License](LICENSE).  
Engineered with โค๏ธ by **[Rafli Arraafi Albaasith](https://github.com/rafliiar17)**.