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:
- Executive Summary
- Primary Source
- Atomic Statements
- Commentary Layer
- Derivation Chain
- Machloket
- Semantic Enrichment
- Gap Analysis
- Questions for Review
- Checkpoint Criteria
- 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:
- Executive Summary
- Statement → Rule Mapping
- World Distribution
- Base World Rules
- World-Specific Rules
- Machloket Encoding
- Pre-Compile Validation
- World Inheritance Diagram
- Output File Preview
- Checkpoint Criteria
- Approval
Customization Points¶
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} rulesCustomization: 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:
- Executive Summary
- Phase A: Compilation Validation
- Phase B: Semantic Validation
- Phase C: Behavioral Testing
- Phase D: Query Verification
- Test Scenarios
- Validation Results Summary
- Checkpoint Criteria
- 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:
- Executive Summary with Timeline
- Component 1: Source Verification
- Component 2: Encoding Review
- Component 3: Validation Evidence
- Component 4: Review Checklists
- Component 5: Questions & Concerns
- Interactive Testing Section
- Output Files
- 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¶
- Create file in
templates/directory:
- 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*
- 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:
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¶
- Maintain Consistency: Keep section ordering consistent across templates
- Use Clear Headers: Section headers should be scannable
- Include Checklists: Help reviewers track verification
- Provide Context: Include enough detail for standalone review
Variable Usage¶
- Use Descriptive Names:
{HEBREW_TEXT}not{HT} - Document Required Variables: Mark which variables must be provided
- Provide Defaults: Use sensible defaults for optional variables
- Validate Content: Check variables are populated before generation
Approval Sections¶
- Clear Instructions: Tell reviewers exactly how to respond
- Multiple Options: Provide approve, revise, and reject paths
- 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.
Related Documentation¶
- Templates Overview - Template reference
- Skills Overview - Skills using templates
- Workflow Guide - End-to-end pipeline