Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bitwikiorg/init.md/llms.txt

Use this file to discover all available pages before exploring further.

The init.md repository includes a static Vite and React website for browsing templates and copying canonical Markdown content. The site renders the template files under templates/ as the authoritative source and provides copy-to-clipboard behavior for the root init.md protocol and complete template bodies. This guide covers local setup, development, and extending the site.

Prerequisites

You need Node.js installed. Check package.json for the version constraints used by the project’s dependencies. No backend, database, or hosted runtime is required — the site is fully static.

Setup and commands

1

Clone the repository

git clone https://github.com/bitwikiorg/init.md.git
cd init.md
2

Install dependencies

npm install
3

Start the dev server

npm run dev
Vite starts a local development server. The base path is set to / during development so all asset and route references resolve correctly.
4

Open the browser

Navigate to the local dev URL printed in the terminal output (typically http://localhost:5173). The site hot-reloads on file changes.
npm run dev

Project structure

PathPurpose
templates/Canonical Markdown source files — the authoritative template content
src/React components and application logic
src/data/templates.tsImports template Markdown via Vite raw imports (?raw); parses frontmatter metadata for display
scripts/check-templates.mjsPre-build template integrity check script
dist/Built output uploaded to GitHub Pages
The templates/ directory is the source of truth. The website imports those files directly — it does not store template bodies as TypeScript strings. When a template is updated, the website reflects the change automatically on the next build or hot reload.

Template integrity check

Running npm run build first executes scripts/check-templates.mjs before compiling the site. The full build command is:
npm run check:templates && tsc -b --noCheck && vite build
The check verifies:
  • All five expected template files exist under templates/:
    • minimal_init_protocol.md
    • dry_run_init_protocol.md
    • development_project_init_protocol.md
    • agent_init_protocol.md
    • server_init_protocol.md
  • Each template file contains a frontmatter block delimited by ---
  • Each template’s frontmatter includes all eight required metadata fields: name, target, purpose, mode, creates, configures, validates, optional_outputs
If any check fails, the script prints the specific error and exits with a non-zero code, preventing the build from continuing. A failing check looks like this:
Missing template file: templates/server_init_protocol.md
# or
Missing metadata frontmatter: templates/dry_run_init_protocol.md
# or
Missing metadata field "validates": templates/minimal_init_protocol.md
Run the check independently at any time with:
npm run check:templates

Adding or updating templates

The Markdown files under templates/ are the canonical source. To update a template, edit the Markdown file directly. The website picks up the change via Vite’s raw import on the next reload or build. To add a new template:
  1. Create a new Markdown file under templates/ with the required frontmatter fields
  2. Add the new template entry to src/data/templates.ts using a Vite raw import (?raw)
  3. Add the new file name to the expectedTemplates array in scripts/check-templates.mjs
The integrity check enforces the expected template list, so a new template file that is not registered in check-templates.mjs will not cause a build failure — but a template registered in the check that is missing from disk will.

Deployment

The site is deployed to GitHub Pages via GitHub Actions. The deploy workflow builds the Vite site and uploads the dist/ artifact to Pages. The base path in vite.config.ts is set automatically from the GITHUB_REPOSITORY environment variable, so the built assets reference the correct repository sub-path. The repository is at https://github.com/bitwikiorg/init.md.
GitHub Pages must use Build and deployment > Source: GitHub Actions for this repository. Deploying from a branch causes the browser to try loading /src/main.tsx directly, which serves the unbuilt Vite source files and breaks the site.

Build docs developers (and LLMs) love