# Dojo-as-Code: AI Dojo Blueprint Specification (v1.0)
Specification Standard:dojo-blueprint.v1
Supported Formats: YAML & JSON
Target Audience: Dojo Owners, Senseis, Systems Integrators, and LLM Copilots.
# 1. Overview & Vision
The Dojo-as-Code blueprint format enables school owners and Senseis to declare their entire martial arts school configuration in a single human-readable YAML or JSON document.
Whether provisioning a new dojo from scratch or calibrating belt ranks, class times, terminology, and branding themes for an existing school, Senseis can simply describe their school to an AI assistant (ChatGPT, Claude, Gemini) and paste the resulting blueprint directly into Dojo Jutsu.
# 2. Blueprint Schema Structure (dojo-blueprint.v1)
schema_version: "1.0"
dojo:
name: "Osaka Aikikai"
slug: "osaka-aikikai"
invite_code: "OSAKA26"
payment_provider: "elavon_terminal" # elavon_terminal, manual_terminal, stripe, square, cash
settings:
theme: "indigo" # forest_green, crimson, indigo, obsidian, bamboo_ochre
grace_period_days: 5
low_credit_threshold: 1
terminology:
head_instructor: "Shihan"
assistant_instructor: "Fukushihan"
student: "Deshi"
curriculum_group: "Aiki Waza"
transfer_letter_title: "Shōkaijō (紹介状) — Letter of Introduction" # Bujutsu/Karate default, or "Official Rank Verification & Transfer Letter"
resume_title: "Jutsu Dossier" # Bujutsu default, or "Martial Arts Resume"
directory: # Optional public directory & finder listing
city: "Pensacola"
state_region: "FL"
postal_code: "32501"
latitude: 30.4213
longitude: -87.2169
style_tags: ["Bujutsu", "Motobu Udundi", "Kobudo", "Traditional"]
schedule_tags: ["0530 Early Morning", "Evening", "Weekend"]
is_directory_listed: true
trial_offer_summary: "Free introductory Keiko session for disciplined seekers"
ranks:
- display_order: 1
name: "6th Kyu - Rokkyu"
belt_color_hex: "#FFFFFF"
stripe_count: 0
min_classes_required: 20
- display_order: 2
name: "5th Kyu - Gokyu"
belt_color_hex: "#F57F17"
stripe_count: 0
min_classes_required: 30
- display_order: 3
name: "1st Dan - Shodan"
belt_color_hex: "#121212"
stripe_count: 0
min_classes_required: 120
schedules:
- title: "Tuesday General Keiko"
day_of_week: 2 # 1=Monday ... 7=Sunday
start_time: "18:30" # 24-hour HH:mm
duration_minutes: 75
location_name: "Main Tatami"
- title: "Saturday Dawn Keiko"
day_of_week: 6
start_time: "05:30"
duration_minutes: 90
location_name: "Main Tatami"
roster: # Optional student import list
- full_name: "Kenji Sato"
rank_name: "6th Kyu - Rokkyu"
plan_type: "recurring_monthly" # recurring_monthly, class_pack, drop_in, comped
paid_days_or_credits: 30# 3. Validation Rules & Field Constraints
| Node / Field | Type | Required | Allowed Values / Constraints |
|---|---|---|---|
schema_version | String | Yes | Must be "1.0". |
dojo.name | String | Yes (for new) | 1–80 characters. |
dojo.slug | String | No | Lowercase alphanumeric with hyphens (^[a-z0-9-]+$). Auto-generated if omitted. |
dojo.invite_code | String | No | Uppercase alphanumeric (^[A-Z0-9_-]+$). Auto-generated if omitted. |
dojo.payment_provider | String | No | elavon_terminal, manual_terminal, stripe, square, clover, cash, zelle. |
settings.theme | String | No | forest_green, crimson, indigo, obsidian, bamboo_ochre. |
settings.grace_period_days | Integer | No | 0 to 30 days (default 5). |
settings.low_credit_threshold | Integer | No | 0 to 5 classes (default 1). |
terminology.head_instructor | String | No | e.g., Sensei, Shihan, Sabumnim, Professor, Sifu. |
terminology.assistant_instructor | String | No | e.g., Senpai, Coach, Instructor. |
terminology.student | String | No | e.g., Student, Deshi, Practitioner. |
terminology.curriculum_group | String | No | e.g., Kata & Kihon, Techniques, Forms, Syllabus. |
terminology.transfer_letter_title | String | No | e.g., "Shōkaijō (紹介状) — Official Letter of Introduction & Rank Transcript" (Bujutsu/Karate default) or "Official Rank Verification & Academy Transfer Letter". |
terminology.resume_title | String | No | e.g., "Jutsu Dossier" (Bujutsu default) or "Martial Arts Resume". Never hardcode "Budo". |
directory.city | String | No | City of physical dojo location (e.g., "Pensacola", "Tokyo"). |
directory.state_region | String | No | State or province (e.g., "FL", "Okinawa"). |
directory.postal_code | String | No | Postal code / ZIP code (e.g., "32501"). |
directory.latitude | Float | No | Geographic latitude (e.g. 30.4213). |
directory.longitude | Float | No | Geographic longitude (e.g. -87.2169). |
directory.style_tags | List[String] | No | Array of martial disciplines (e.g. ["Bujutsu", "Motobu Udundi", "Kobudo", "Karate", "BJJ"]). |
directory.schedule_tags | List[String] | No | Array of session tags (e.g. ["0530 Early Morning", "Evening", "Weekend"]). |
directory.is_directory_listed | Boolean | No | Whether the dojo appears in public radar directory (true / false). |
directory.trial_offer_summary | String | No | Short trial description for prospective seekers. |
ranks[].display_order | Integer | Yes | Unique positive integer (1 = introductory/lowest rank). |
ranks[].name | String | Yes | Name of rank/belt level (e.g. 10th Kyu - White Belt). |
ranks[].belt_color_hex | String | Yes | 6-character hex color format: ^#[0-9A-Fa-f]{6}$. |
ranks[].stripe_count | Integer | No | 0 through 4 stripes (default 0). |
ranks[].min_classes_required | Integer | No | Positive integer (default 20). |
schedules[].title | String | Yes | Class name (e.g. Saturday Morning Keiko). |
schedules[].day_of_week | Integer | Yes | 1 (Monday) through 7 (Sunday). |
schedules[].start_time | String | Yes | 24-hour time format: ^\d{2}:\d{2}$ (e.g. 05:30, 18:45). |
schedules[].duration_minutes | Integer | No | Positive integer (default 90). |
roster[].full_name | String | Yes | Student full name. |
roster[].rank_name | String | No | Matched case-insensitively against dojo ranks. |
roster[].plan_type | String | No | recurring_monthly, class_pack, drop_in, comped. |
# 4. Foreign-Key-Safe Natural-Key Upsert Semantics
When importing into an existing dojo, existing records in SQLite must never be deleted blindly because other tables (such as dojo_members.current_rank_id, attendance_logs.schedule_id, and student_curriculum_progress) hold foreign keys to them.
- Ranks Natural-Key Matching:
- Matches existing rank rows by
display_orderfirst, or case-insensitivename. - If a match is found: updates
name,belt_color_hex,stripe_count, andmin_classes_requiredin-place while preserving the existing UUIDid. - If no match is found: inserts a new rank with a generated UUID.
- Class Schedules Natural-Key Matching:
- Matches existing schedules by
day_of_weekandstart_time. - If matched: updates
title,duration_minutes, andlocation_namein-place while preserving the existing UUIDid. - If not matched: inserts a new schedule with a generated UUID.
- Settings & Terminology:
- Deep-merged into
dojos.settings_jsonso custom unmentioned preferences are not lost. - Outbox Synchronization:
- Every modified or created rank, schedule, and dojo record automatically enqueues an
UPDATEorINSERTtosync_queuefor cloud replication.
# 5. Sensei AI Prompt Template
Copy and paste the prompt below into ChatGPT, Claude, or Gemini to produce a valid dojo-blueprint.v1 file:
You are an expert martial arts school curriculum and operations architect.
Generate a valid YAML configuration according to the "dojo-blueprint.v1" schema for my martial arts school.
Here are the details of my school:
- Art / Style: [e.g. Brazilian Jiu-Jitsu / Shotokan Karate / Aikido / Judo / Taekwondo]
- School Name: [e.g. Shindokan Dojo]
- Sensei / Head Title: [e.g. Professor / Sensei / Sabumnim]
- Color Theme: [forest_green, crimson, indigo, obsidian, or bamboo_ochre]
- Belts / Ranks: [List belt progression from beginner to black belt]
- Weekly Class Schedule: [List class times, days of week, and titles]
Output ONLY valid YAML matching this specification:schema_version: "1.0"
dojo:
name: "..."
slug: "..."
invite_code: "..."
payment_provider: "elavon_terminal"
settings:
theme: "..."
grace_period_days: 5
low_credit_threshold: 1
terminology:
head_instructor: "..."
assistant_instructor: "..."
student: "..."
curriculum_group: "..."
transfer_letter_title: "..." # e.g. "Shōkaijō (紹介状) — Letter of Introduction" or "Official Rank Verification & Transfer Letter"
resume_title: "..." # e.g. "Jutsu Dossier" or "Martial Arts Resume" (never "Budo")
directory: # Optional radar directory listing
city: "..."
state_region: "..."
postal_code: "..."
style_tags: ["..."]
schedule_tags: ["..."]
is_directory_listed: true
ranks:
- display_order: 1
name: "..."
belt_color_hex: "#..."
stripe_count: 0
min_classes_required: 20
schedules:
- title: "..."
day_of_week: 1
start_time: "18:00"
duration_minutes: 60
Do not include commentary, markdown explanations, or additional text outside the YAML block.