Skip to content

About

Non-official USMC Naval Letter Generator PoC. Client-side formatting tool with compliance documentation and mandatory legal consent. Generates MCO, MCBul, MOA, and directive documents to DoD standards.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

964 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Semper Scribe logo

Semper Scribe

USMC correspondence, formatted right — entirely in your browser.

Tests CodeQL Deploy License: MIT Local First

Live App · Report an Issue · Security Policy

Warning

Not Official USMC Software. Semper Scribe is a non-official Proof of Concept maintained on a personal basis. It is not USMC, DON, or DoD software and carries no Authority to Operate. Use is at the user's discretion and risk. All processing happens in the browser. Never enter classified information. Whether CUI is permitted depends on the system you run it on and on your authorizing official's approval of this application for that use (DoDI 5200.48 paragraphs 3.3.c and 3.10.b). Until your command has granted that approval, do not enter CUI. PII such as names and EDIPI is accepted at the user's discretion and risk: the formatter never transmits it, and every export is scanned for SSN and EDIPI patterns before the file is written. A name or an EDIPI is not CUI on its own. Whether a completed record about a real Marine is CUI (Privacy, marking PRVCY) is determined by your command's guidance, not by this application; where it is, the CUI condition above applies to it. See the Privacy and Security Notice and SECURITY.md for full details.

A professional-grade, local-first web application for creating, formatting, and exporting USMC correspondence and administrative documents. Built with Next.js, Semper Scribe helps users produce properly formatted documents aligned with SECNAV M-5216.5 and MCO 5215.1K — entirely in the browser, with no server-side processing.

Highlights

  • 📄 27 document types across 9 categories — from Basic Letters to Marine Corps Orders, AMHS messages, NJP forms, and technical publications
  • 📥 Word/PDF import — upload an existing .docx or PDF (even a badly formatted one), review the extracted fields, and export it compliant
  • 👀 Live PDF preview as you type, with a compliance-issue banner
  • 📦 Export anywhere — PDF, DOCX, AMHS plain text, batch mail-merge ZIPs, shareable links
  • 🔒 Local-first — no backend, no telemetry. Document formatting never leaves the browser. The one exception is the optional GunnyBot assistant, off until you add your own provider key, which sends only the text you submit to it.
  • 🛡️ Sensitive-data check before export — every download (PDF, DOCX, official form, batch, data package, AMHS text, the NAVMC 10132 sheets and the package merge) and the backup-folder copy is scanned for SSN and EDIPI patterns and PHI keyword clusters, and asks before the file is written. It asks; it never blocks and never rewrites your text

Document Types

Standard Letters (3)
Type Description
Basic Letter Standard format for routine correspondence and official communications
Multiple-Address Letter Letter addressed to two or more commands/activities
Endorsement Forwards correspondence on a new page with automatic routing
Memorandums (5)
Type Description
Memorandum for the Record Internal document to record events or decisions (no "To" line)
From-To Memorandum Informal internal correspondence on plain paper
Letterhead Memorandum Formal memo for correspondence within the activity or with other federal agencies
Memorandum of Agreement Agreement between two or more parties (conditional)
Memorandum of Understanding General understanding between two or more parties (non-binding)
Staffing Papers (4)
Type Description
Information Paper Provides factual information in concise terms
Position Paper Advocates a specific position or solution
Decision Paper Requests a decision from a senior official
Coordination Page Mandatory staffing table for routing packages per MCO 5216.20B
External & Executive (2)
Type Description
Business Letter Correspondence with non-DoD entities or personal approach
Executive Correspondence Letters and memorandums for HqDON, Congress, OSD, and senior officials
DLA Correspondence (2)
Type Description
DLA Memorandum Defense Logistics Agency internal memorandum format
DLA Business Letter DLA correspondence with external entities
Directives (5)
Type Description
Marine Corps Order (MCO) Permanent directives that establish policy or procedures
Marine Corps Bulletin (MCBul) Directives of a temporary nature (expire after 12 months)
Change Transmittal Transmits amendments (page replacements) to an existing order per MCO 5215.1K
SECNAV Instruction Secretary of the Navy permanent directives per SECNAV M-5215.1
SECNAV Notice Secretary of the Navy directives of a temporary nature
Forms (2)
Type Description
AA Form (NAVMC 10274) Administrative Action form for personnel requests
Page 11 (NAVMC 118-11) Administrative Remarks for service record entries
Technical Publications (1)
Type Description
I-Type Publication Technical manual cover and administrative pages with End Items table
Messages (1)
Type Description
AMHS Message Automated Message Handling System (GENADMIN/MARADMIN/ALMAR) with DTG, references, NARR, and POC sections

Features

✍️ Document Editing

  • Dynamic Forms — Conditional field display and validation per document type
  • Multi-Level Paragraphs — Supports 1., 1.a., 1.a.(1), etc. with add, remove, and reorder
  • Voice Input — Browser Speech Recognition API for dictating paragraph content
  • Spell Check — Client-side spell checking with military-specific dictionary and acronym detection
  • References & Enclosures — Lettered references and numbered enclosures with structured input
  • Via Chain & Distribution — Routing through intermediate commands, copy-to and distribution statement management

📥 Import

  • Word/PDF Document Import — Upload an existing .docx or PDF (even a badly formatted one); fields, references, enclosures, and paragraphs are extracted in the browser with rule-based parsing, presented in a review-and-confirm modal, then dropped into the normal editing flow for a compliant re-export
  • NLDP Import — Naval Letter Data Package format for portable document data
  • Shareable Links — Load a full document state from a compressed URL

📤 Export & Output

  • PDF Export — Multi-pipeline PDF generation with proper formatting per document type
  • DOCX Export — Microsoft Word format via the docx library
  • AMHS Text Export — Plain text export formatted for AMHS message systems
  • Batch Generation (Mail Merge) — Import a CSV, substitute {{TOKEN}} fields, generate a ZIP of PDFs
  • Signature Placement — Interactive signature field positioning on generated PDF pages
  • NLDP Export — Save the full document as a portable data package

👀 Preview & Proofread

  • Live Preview — Real-time PDF rendering as you type (desktop side panel or mobile modal)
  • Proofread Checklist — Four-category compliance check per SECNAV M-5216.5, Ch 2, Para 19: Format, Framework, Typography & Grammar, and Content, with Pass/Fail/Warn/Manual statuses

⚙️ Settings & Profile

  • User Profile — Store your unit (searchable RUC database), signature name, from title, originator code, rank, and title
  • Auto-Fill — Profile fields automatically populate new documents
  • Formatting Defaults — Header type (USMC/DON/DLA), body font, header color, AMHS classification and precedence
  • Appearance — Light, dark, and system theme support

🗂️ Templates & Drafts

  • Template Browser — Pre-built global and unit-specific document templates
  • Draft Saving — Auto-save to browser localStorage with load/manage from the File menu

📡 AMHS Message Features

  • Auto-generated Date-Time Group (DTG) in Zulu time, reference management with letter designators, NARR auto-generation, POC manager, message validation, and a terminal-style preview

📱 Responsive Design

  • Desktop three-pane layout (sidebar, editor, preview); mobile-friendly forms with a slide-up preview modal

Getting Started

Prerequisites

  • Node.js 22+ (the active LTS; Node 20 reached end of life in April 2026)
  • npm

Installation

git clone https://github.com/SemperAdmin/semperscribe.git
cd semperscribe
npm install
npm run dev

Open http://localhost:3000 in your browser.

Production Build

npm run build

Static output is written to the out/ directory, ready for deployment to any static hosting provider.

Deploy to GitHub Pages

The repository includes a GitHub Actions workflow (.github/workflows/deploy.yml) that automatically builds and deploys to GitHub Pages on pushes to main. Manual deployment is also available via workflow_dispatch.

Headless companion

SemperScribe also runs without a browser. The companion/ directory holds an HTTP server and an MCP stdio server which share one set of operations: list the document types, describe the fields a type takes, validate an NLDP package, and render it to PDF or DOCX. It is meant for an EDMS, a script, or an agent, and it renders the same file the editor downloads.

npm run companion          # HTTP on http://127.0.0.1:7719
npm run companion:mcp      # MCP over stdio

The HTTP server binds loopback and carries no authentication. The export sensitive-data gate is mirrored: findings refuse the render until the caller acknowledges them. Routes, request and response examples, the MCP client configuration, and the full security posture are in docs/COMPANION.md.

Project Structure

Expand the source tree overview
src/
├── app/                        # Next.js App Router pages
│   ├── page.tsx                # Main application entry point
│   └── dynamic-forms/          # Dynamic form route
├── components/
│   ├── ui/                     # Base UI library (shadcn/ui + Radix)
│   ├── layout/                 # App shell, sidebar, header, preview, theme
│   ├── letter/                 # Letter section components (references, enclosures, etc.)
│   ├── document/               # Document layout, header settings, signature fields
│   ├── import/                 # Word/PDF import review modal
│   ├── amhs/                   # AMHS editor, preview, POC manager
│   ├── pdf/                    # PDF rendering components
│   ├── wizard/                 # Multi-step document type wizard
│   ├── SettingsDialog.tsx      # User profile and app settings
│   ├── BatchGenerateModal.tsx  # Mail merge / batch generation
│   └── ProofreadModal.tsx      # Proofreading checklist
├── hooks/                      # React hooks
│   ├── useUserProfile.ts       # Profile persistence and form defaults
│   ├── useParagraphs.ts        # Paragraph CRUD and citation generation
│   ├── useDocumentImport.ts    # Word/PDF import orchestration
│   ├── useImportExport.ts      # Document import/export and sharing
│   ├── useBatchGenerate.ts     # Mail merge engine
│   └── ...
├── lib/                        # Utilities and configuration
│   ├── schemas.ts              # Document type definitions and field schemas
│   ├── units.ts                # USMC unit database (RUC/MCC lookup)
│   ├── url-state.ts            # Shareable link encoding/decoding
│   └── ...
├── services/
│   ├── export/                 # Central PDF orchestrator
│   ├── import/                 # Word/PDF text extraction and correspondence parsing
│   ├── pdf/                    # Per-document-type PDF generators
│   ├── docx/                   # Per-document-type DOCX generators
│   └── amhs/                   # AMHS message formatting
└── types/                      # TypeScript type definitions

Security & Privacy

Important

This tool is for UNCLASSIFIED information only. Never input, process, or store classified data. CUI is permitted only on a DoD information system authorized at the moderate confidentiality level and only once your authorizing official has approved this application for that use (DoDI 5200.48 paragraphs 3.3.c and 3.10.b). This project holds no such authorization of its own. PII (names, EDIPI, similar identifiers) is entered at the user's discretion and risk. The formatter never transmits it, and every export is scanned before the file is written. Never send CUI to GunnyBot through a commercial provider.

  • Local-First Architecture — All document formatting, import, and export happens entirely in the browser. The formatter transmits nothing to any server.
  • GunnyBot Is the One Egress Path — The optional GunnyBot assistant stays off until you supply a personal provider API key. When you use it, the text you submit goes directly from your browser to the provider you chose (Google Gemini or GenAI.mil) under your key. A pre-send scan prompts on SSN and EDIPI patterns. See SECURITY.md for the full data-flow statement.
  • Pre-Export Scan — Before any PDF, DOCX, official-form, or batch ZIP download, the document is scanned for SSN and EDIPI patterns and PHI keyword clusters. A hit prompts for acknowledgement. It does not certify a document free of CUI, PII, or classified material.
  • No Backend — Static site deployment. No server-side code, no database, no API calls.
  • Local Storage Only — Drafts and user profiles are stored in browser localStorage.
  • Verification Required — While Semper Scribe automates formatting, the final content is the responsibility of the originator. Always verify references and administrative details against current directives.

Compliance Posture

Semper Scribe undergoes voluntary alignment with DoD adoption-readiness standards. This is not an authorized DoD system and carries no Authority to Operate.

What the alignment covers
  • Software Supply Chain (SCRM) — SBOM generated on every deploy via CycloneDX, and the deploy waits on it. npm audit at high severity over the production tree gates every CI run, so a new high or critical advisory fails the build rather than shipping. Maps to Executive Order 14028 SBOM requirements and the DoD CIO SWFT Initiative memo.
  • Secure Software Development Framework (SSDF) — Aligned with NIST SP 800-218 practices PO.3.3 (toolchain configuration), PW.4.1 and PW.4.4 (third-party component management), PW.7 (review and analyze code), and PS.1 (source protection). CodeQL static analysis runs on every push and weekly.
  • Open Source Software — Project license is MIT. Dual-license elections documented in LICENSES.md. All transitive licenses are approved per DoD CIO OSS Guidance dated 24 January 2022, Attachment 2 paragraph 3G.
  • Privacy — No PII collection by the project, no telemetry, no backend at runtime. PII a user types stays in that user's browser and is scanned before export; any Privacy Act obligation for it is the user's. The opt-in GunnyBot data flow is the documented exception. User responsibility framing applied throughout the UI. See the in-app Privacy and Security Notice and SECURITY.md.
  • Records Management — Tool outputs become Federal records under 44 USC 3301 when used in official business. Routing through a Command Designated Records Manager per MCO 5210.11F is the user's responsibility, not the application's.
What the alignment does not cover
  • This is not under the Risk Management Framework. DoDI 8510.01 does not apply to a personal PoC.
  • This is not registered as an Electronic Information System under MCO 5210.11F. Tool outputs are records; the tool itself is not an EIS.
  • This project carries no CUI authorization of its own. CUI processing is a decision for the authorizing official of the system the application runs on, and until a command has made it, users must not enter CUI. Classified material is never permitted. PII and PHI are accepted at the user's discretion and risk, with the user carrying any Privacy Act or HIPAA obligation that follows.

See docs/COMPLIANCE_REMEDIATION_PLAN.md for the full audit trail of the alignment work.

Reporting Security Issues

Vulnerabilities should be reported through GitHub's Private Vulnerability Reporting. See SECURITY.md for the disclosure channel and response expectations.

Tech Stack

Category Technology
Framework Next.js 16, React 18, TypeScript 5
UI Tailwind CSS, shadcn/ui, Radix UI, Lucide icons
Forms React Hook Form, Zod validation
State React hooks, Zustand
PDF @react-pdf/renderer, pdf-lib, pdfjs-dist
DOCX docx (generation), mammoth (import)
Theming next-themes (light/dark/system)
Compression lz-string
Testing Vitest, Testing Library

Contributing

Contributions are welcome. Please submit issues and pull requests on GitHub.

License

MIT License. See LICENSE for the legal text and LICENSES.md for the third-party license inventory, dual-license elections, and LGPL transitive documentation. The license election is recorded per DoD CIO OSS Guidance paragraph 3G.


Semper Fidelis 🦅

About

Non-official USMC Naval Letter Generator PoC. Client-side formatting tool with compliance documentation and mandatory legal consent. Generates MCO, MCBul, MOA, and directive documents to DoD standards.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages