Skip to content

Template Customization

This guide covers how to customize the report templates used by the Mistaber encoding pipeline to match your organization's documentation standards and workflow requirements.

Customization Overview

Templates can be customized at three levels:

Level Scope Location Impact
Global All sessions templates/*.md Affects all future artifacts
Session Current session .mistaber-session.yaml Affects current session only
Instance Single artifact Generated file One-time override

Template File Structure

Each template is a Markdown file with variable placeholders:

# {Report Type}: YD {SIMAN}:{SEIF}

**{Action}:** {TIMESTAMP}
**Status:** Pending Review

---

## [Section Content]

{VARIABLE_PLACEHOLDER}

---

Variable Syntax

Variables use curly brace syntax: {VARIABLE_NAME}

Naming Conventions:

Convention Example Usage
{UPPERCASE} {SIMAN} Required variables
{LOWER_CASE} {rule_id} Optional/generated
{TYPE_PREFIX} {HEBREW_TEXT} Typed content

Corpus Report Template

File: templates/corpus-report.md

Key Sections:

  1. Executive Summary
  2. Primary Source
  3. Atomic Statements
  4. Commentary Layer
  5. Derivation Chain
  6. Machloket
  7. Semantic Enrichment
  8. Gap Analysis
  9. Questions for Review
  10. Checkpoint Criteria
  11. Approval

Customization Points

Executive Summary Metrics

## Executive Summary

| Metric | Value |
|--------|-------|
| Reference | YD {SIMAN}:{SEIF} |
| Topic | {TOPIC_TITLE} |
| Complexity Score | {SCORE}/10 |
| Machloket Count | {N} |
| Commentary Depth | Tier {N} |
| Questions for Review | {N} |

Customization: Add or remove metrics as needed.

Commentary Tiers

The template supports four commentary tiers:

### Tier 1: Primary Commentators
#### Shach (Siftei Kohen)
#### Taz (Turei Zahav)

### Tier 2: Secondary Commentators
{IF FETCHED}

### Tier 3: Extended Commentators
{IF FETCHED}

### Tier 4: Modern Authorities
{IF FETCHED}

Customization: Adjust tier definitions based on your study methodology.

Statement Classification

### Statement Classification Key

- **ISSUR**: Prohibition
- **HETER**: Permission
- **CHIYUV**: Obligation
- **DEFINITION**: Category definition
- **CONDITION**: Prerequisite condition
- **EXCEPTION**: Exception to general rule

Customization: Add custom statement types for your domain.

Adding Custom Questions

The questions section uses structured format:

### Q{N}: {QUESTION_TITLE}

**Phase:** {PHASE}
**Type:** {CLARIFICATION/INTERPRETATION/RESEARCH/MACHLOKET}

**Question:** {FULL_QUESTION}

**Context:** {CONTEXT_EXPLANATION}

**Options:**
1. {OPTION_1} (Recommended)
2. {OPTION_2}
3. Other: ____________

**Default:** Option {N}

Customization: Define your own question types and option formats.

Encoding Report Template

File: templates/encoding-report.md

Key Sections:

  1. Executive Summary
  2. Statement → Rule Mapping
  3. World Distribution
  4. Base World Rules
  5. World-Specific Rules
  6. Machloket Encoding
  7. Pre-Compile Validation
  8. World Inheritance Diagram
  9. Output File Preview
  10. Checkpoint Criteria
  11. Approval

Customization Points

World Distribution

### World Distribution
Base World (universal): {N} rules ├── Mechaber (Sefardi): {N} rules │ └── sefardi_yo: {N} rules (inherited) ├── Rema (Ashkenazi): {N} rules │ ├── ashk_mb: {N} rules (inherited) │ └── ashk_ah: {N} rules (inherited) └── Gra: {N} rules

Customization: Modify tree structure to match your world hierarchy.

Predicate Validation Table

### Predicate Validation

| Predicate | Arity | Registered | Status |
|-----------|-------|------------|--------|
| issur | 3 | ✓ | Valid |
| heter | 2 | ✓ | Valid |
| sakana | 1 | ✓ | Valid |

Customization: Add custom predicates to the validation table.

World Inheritance Diagram

graph TD
    BASE["base<br/>{N} rules"] --> MECH["mechaber<br/>{N} rules"]
    BASE --> REMA["rema<br/>{N} rules"]
    BASE --> GRA["gra<br/>{N} rules"]
    MECH --> SEF["sefardi_yo<br/>(inherits)"]
    REMA --> ASHK_MB["ashk_mb<br/>(inherits)"]
    REMA --> ASHK_AH["ashk_ah<br/>(inherits)"]
    GRA --> ASHK_AH

Customization: Update diagram to reflect your world topology.

Validation Report Template

File: templates/validation-report.md

Key Sections:

  1. Executive Summary
  2. Phase A: Compilation Validation
  3. Phase B: Semantic Validation
  4. Phase C: Behavioral Testing
  5. Phase D: Query Verification
  6. Test Scenarios
  7. Validation Results Summary
  8. Checkpoint Criteria
  9. Approval

Customization Points

Validation Phases

The default template includes four validation phases:

Phase Purpose
A Compilation (HLL, Grounding, SAT)
B Semantic (Disjointness, Madrega, Inheritance)
C Behavioral (Positive, Negative, Edge, Machloket)
D Query (API, Derivation, Performance)

Customization: Add or remove phases based on your validation requirements.

Test Categories

### Test Suite Summary

| Category | Passed | Failed | Skipped | Coverage |
|----------|--------|--------|---------|----------|
| Positive | {N} | {N} | {N} | {N}% |
| Negative | {N} | {N} | {N} | {N}% |
| Edge Cases | {N} | {N} | {N} | {N}% |
| Machloket | {N} | {N} | {N} | {N}% |
| Regression | {N} | {N} | {N} | {N}% |

Customization: Define custom test categories.

Performance Targets

### Performance Tests

| Metric | Target | Actual | Status |
|--------|--------|--------|--------|
| Grounding time | < 100ms | {N}ms | {PASS/FAIL} |
| First query | < 50ms | {N}ms | {PASS/FAIL} |
| Subsequent queries | < 10ms | {N}ms | {PASS/FAIL} |
| Memory usage | < 100MB | {N}MB | {PASS/FAIL} |

Customization: Adjust performance thresholds for your environment.

Review Package Template

File: templates/review-package.md

Key Sections:

  1. Executive Summary with Timeline
  2. Component 1: Source Verification
  3. Component 2: Encoding Review
  4. Component 3: Validation Evidence
  5. Component 4: Review Checklists
  6. Component 5: Questions & Concerns
  7. Interactive Testing Section
  8. Output Files
  9. Final Approval with Signatures

Customization Points

Session Timeline

### Session Timeline

| Checkpoint | Status | Approved By | Timestamp |
|------------|--------|-------------|-----------|
| Corpus Preparation | {STATUS} | {APPROVER} | {TIMESTAMP} |
| HLL Encoding | {STATUS} | {APPROVER} | {TIMESTAMP} |
| Validation | {STATUS} | {APPROVER} | {TIMESTAMP} |
| Final Review | ⏳ Pending | - | - |

Customization: Add or modify checkpoint stages.

Review Checklists

Halachic Accuracy Checklist:

| # | Check | Status | Notes |
|---|-------|--------|-------|
| H1 | Ruling accurately represents SA text | ☐ | |
| H2 | All conditions from source captured | ☐ | |
| H3 | Machloket positions accurately encoded | ☐ | |
| H4 | Makor chain reaches authoritative source | ☐ | |
| H5 | Commentary interpretations correct | ☐ | |
| H6 | Madrega levels appropriate | ☐ | |
| H7 | No rulings invented or inferred | ☐ | |
| H8 | World assignments match authority | ☐ | |

Customization: Add organization-specific halachic verification items.

Technical Accuracy Checklist:

| # | Check | Status | Notes |
|---|-------|--------|-------|
| T1 | Predicates correctly chosen | ☐ | |
| T2 | Arity matches predicate definition | ☐ | |
| T3 | Variables properly scoped | ☐ | |
| T4 | NAF used appropriately | ☐ | |
| T5 | World inheritance correct | ☐ | |
| T6 | Overrides properly structured | ☐ | |
| T7 | All rules have unique IDs | ☐ | |
| T8 | File structure follows conventions | ☐ | |

Customization: Add technical verification items for your system.

Review Signatures

## Review Signatures

| Role | Name | Approval | Timestamp |
|------|------|----------|-----------|
| Technical Reviewer | {NAME} | ☐ | |
| Halachic Reviewer | {NAME} | ☐ | |
| Final Approver | {NAME} | ☐ | |

Customization: Define required review roles.

Adding Custom Templates

Creating a New Template

  1. Create file in templates/ directory:
touch mistaber-skills/templates/custom-report.md
  1. Add standard structure:
# {REPORT_TYPE}: YD {SIMAN}:{SEIF}

**Generated:** {TIMESTAMP}
**Status:** Pending Review

---

## Executive Summary

| Metric | Value |
|--------|-------|
| Reference | YD {SIMAN}:{SEIF} |
| [Custom metrics...] |

---

## [Custom Sections]

[Content...]

---

## Checkpoint Review Criteria

- [ ] [Verification items]

---

## Approval

To approve, respond with:
> "Approved"

---

*Generated by Mistaber Encoding Pipeline*
  1. Register in skill that uses it (update SKILL.md).

Variable Reference

Standard Variables (available in all templates):

Variable Type Description
{SIMAN} number Siman number
{SEIF} number Seif number
{TIMESTAMP} string ISO 8601 timestamp
{TOPIC_TITLE} string Topic description
{SESSION_ID} string Unique session ID

Content Variables:

Variable Type Description
{HEBREW_TEXT} string Hebrew source text
{ENGLISH_TRANSLATION} string English translation
{RULE_ID} string Rule identifier
{PREDICATE} string Predicate expression
{WORLD} string World name
{MADREGA} string Madrega level

Computed Variables:

Variable Type Description
{N} number Count (context-dependent)
{SCORE} number Complexity score
{PASS/FAIL} string Test status
{SAT/UNSAT} string Satisfiability result

Conditional Sections

Templates support conditional content:

{IF MACHLOKET EXISTS}
## Machloket (Disputes)

### Machloket 1: {TOPIC}

[Content...]
{/IF}

Supported Conditionals:

Conditional Condition
{IF MACHLOKET EXISTS} Machloket found in sources
{IF ANY} List not empty
{IF FAIL} Validation failed
{IF SAT} Satisfiable result
{IF UNSAT} Unsatisfiable result
{IF ANY CONCERNS} Outstanding concerns exist
{IF NO CONCERNS} No outstanding concerns

Iteration Blocks

Templates support iteration over lists:

{FOR EACH RULE}
#### {RULE_ID}

**Statement:** {ORIGINAL_STATEMENT}
**Predicate:** `{PREDICATE}`

[Content...]

---
{/FOR EACH}

Supported Iterations:

Iterator Content
{FOR EACH RULE} Each encoded rule
{FOR EACH TEST} Each test case
{FOR EACH MACHLOKET} Each dispute
{FOR EACH OVERRIDE} Each override
{FOR EACH QUESTION} Each clarifying question
{FOR EACH FAILURE} Each failed test

Best Practices

Template Design

  1. Maintain Consistency: Keep section ordering consistent across templates
  2. Use Clear Headers: Section headers should be scannable
  3. Include Checklists: Help reviewers track verification
  4. Provide Context: Include enough detail for standalone review

Variable Usage

  1. Use Descriptive Names: {HEBREW_TEXT} not {HT}
  2. Document Required Variables: Mark which variables must be provided
  3. Provide Defaults: Use sensible defaults for optional variables
  4. Validate Content: Check variables are populated before generation

Approval Sections

  1. Clear Instructions: Tell reviewers exactly how to respond
  2. Multiple Options: Provide approve, revise, and reject paths
  3. Document Impact: Explain what each choice does

Troubleshooting

Missing Variables

Symptom: {VARIABLE} appears in generated output.

Cause: Variable not provided to template.

Fix: Ensure all required variables are populated before generation.

Broken Conditionals

Symptom: {IF ...} appears in output.

Cause: Conditional not properly evaluated.

Fix: Verify conditional syntax matches supported patterns.

Iteration Issues

Symptom: {FOR EACH} appears or content missing.

Cause: Iterator not properly processed.

Fix: Ensure list data is provided for iteration.