Workflow Guide Skill¶
The workflow-guide skill provides comprehensive documentation of the entire Mistaber encoding pipeline, explaining the phases, checkpoints, and best practices for systematic halachic encoding.
Overview¶
| Attribute | Value |
|---|---|
| Skill Name | workflow-guide |
| Phase | N/A (Documentation only) |
| Checkpoint | None |
| Prerequisites | None |
| Outputs | None (informational) |
| Trigger Phrases | "how does encoding work", "what is the workflow", "explain the pipeline", "encoding overview", "workflow help" |
Pipeline Architecture¶
The Mistaber encoding pipeline transforms halachic source texts into formal logical rules through a supervised, checkpoint-based workflow.
+---------------------------------------------------------------------+
| ENCODING PIPELINE |
+---------------------------------------------------------------------+
| |
| +----------------+ +----------------+ +----------------+ |
| | SKILL 1 |--->| SKILL 2 |--->| SKILL 3 | |
| | corpus-prep | | hll-encode | | validate | |
| +-------+--------+ +-------+--------+ +-------+--------+ |
| | | | |
| [CHECKPOINT 1] [CHECKPOINT 2] [CHECKPOINT 3] |
| Human reviews Human reviews Human reviews |
| source chain encoded rules test results |
| |
| +----------------+ +----------------+ |
| | SKILL 4 |--->| SKILL 5 | |
| | review | | commit | |
| +-------+--------+ +----------------+ |
| | |
| [CHECKPOINT 4] |
| Final approval |
+---------------------------------------------------------------------+
The Five Skills¶
Skill 1: Corpus Preparation¶
Purpose: Fetch and organize source texts from Sefaria, build complete derivation chains.
Invocation: mistaber:corpus-prep
Key Activities:
- Validate seif reference with Sefaria
- Fetch primary text (Hebrew + English)
- Fetch commentaries (Shach, Taz, etc.)
- Build derivation chain (SA -> Tur -> Rambam -> Gemara -> Torah)
- Identify machloket (disputes)
- Generate questions for human
Artifacts:
| Artifact | Purpose |
|---|---|
corpus-report.md |
Human-readable summary |
corpus-sources.yaml |
Machine-readable data |
corpus-chain.mermaid |
Visual derivation chain |
corpus-questions.yaml |
Questions for human |
Checkpoint 1: Human reviews source chain, answers questions, approves corpus.
Skill 2: HLL Encoding¶
Purpose: Transform approved corpus into HLL/ASP rules with proper world scoping.
Invocation: mistaber:hll-encode
Key Activities:
- Map statements to predicates
- Generate base world rules (universal)
- Generate world-specific rules (Mechaber, Rema)
- Encode machloket with override mechanism
- Attach makor chains to all rules
- Pre-compile validation
Artifacts:
| Artifact | Purpose |
|---|---|
base.lp |
Shared definitions |
mechaber.lp |
Mechaber-specific rules |
rema.lp |
Rema-specific rules |
encoding-report.md |
Encoding summary |
encoding-mapping.yaml |
Statement-rule mapping |
Checkpoint 2: Human reviews encoded rules, verifies world scoping, approves encoding.
Skill 3: Validation¶
Purpose: Compile rules, run semantic checks, execute test scenarios.
Invocation: mistaber:validate
Key Activities:
- HLL compilation
- ASP grounding test
- Satisfiability check (SAT/UNSAT)
- Semantic validation (disjointness, inheritance)
- Generated test execution
- Machloket verification
- Regression testing
Artifacts:
| Artifact | Purpose |
|---|---|
validation-report.md |
Test results summary |
validation-results.yaml |
Machine-readable results |
test-scenarios.yaml |
Test scenarios for regression |
Checkpoint 3: Human reviews test results, verifies all tests pass, approves validation.
Skill 4: Review¶
Purpose: Assemble comprehensive review package for final human approval.
Invocation: mistaber:review
Key Activities:
- Assemble executive summary
- Present source verification
- Display encoded rules with highlighting
- Show validation evidence
- Present halachic accuracy checklist
- Present technical accuracy checklist
- Enable interactive query testing
Artifacts:
| Artifact | Purpose |
|---|---|
review-package.md |
Complete review package |
Checkpoint 4: Human completes both checklists, tests queries, gives final approval.
Skill 5: Commit¶
Purpose: Finalize and commit approved encoding to repository.
Invocation: mistaber:commit
Key Activities:
- Verify all checkpoints cleared
- Final validation run
- Organize files
- Update manifest
- Archive session artifacts
- Create git commit
- Update progress tracking
- Suggest next steps
Artifacts:
| Output | Purpose |
|---|---|
| Git commit | Version-controlled changes |
| Manifest update | Siman metadata |
| Session archive | Historical record |
No checkpoint: Commit is the final action after all approvals.
Checkpoint Requirements¶
What Checkpoints Enforce¶
| Checkpoint | Phase | Blocks Until |
|---|---|---|
| 1 | Corpus | Human approves source chain and answers questions |
| 2 | Encode | Human approves rule encoding and world scoping |
| 3 | Validate | Human approves test results (all pass) |
| 4 | Review | Human completes both checklists |
Checkpoint Flow¶
corpus-prep --- CHECKPOINT 1 ---> hll-encode --- CHECKPOINT 2 --->
| |
v v
"Approve corpus?" "Approve encoding?"
| |
YES YES
| |
v v
Continue Continue
validate --- CHECKPOINT 3 ---> review --- CHECKPOINT 4 ---> commit
| |
v v
"Approve tests?" "Final approval?"
| |
YES YES
| |
v v
Continue COMMIT!
Checkpoint Approval Phrases¶
| Phrase | Effect |
|---|---|
| "Approved" | Approve current checkpoint |
| "Looks good" | Approve current checkpoint |
| "Correct" | Approve current checkpoint |
| "Needs revision: [feedback]" | Request changes |
| "Reject: [reason]" | Cancel session |
Starting an Encoding Session¶
Step 1: Invoke Corpus Preparation¶
The agent invokes corpus-prep, which will:
- Validate the reference
- Fetch texts from Sefaria
- Build derivation chain
- Generate artifacts
- Request checkpoint approval
Step 2: Review and Approve Corpus¶
Review the generated artifacts:
- Check source accuracy
- Answer questions in
corpus-questions.yaml - Verify derivation chain
Step 3: Continue Through Pipeline¶
Each subsequent skill is invoked after approval:
User: "Encode the rules" -> hll-encode skill
User: "Run validation" -> validate skill
User: "Prepare review" -> review skill
User: "Commit the encoding" -> commit skill
Session State Management¶
Session State File¶
The workflow maintains state in .mistaber-session.yaml:
current_phase: hll-encode
target_seif: "YD:88:1"
started: 2026-01-25T10:00:00Z
last_activity: 2026-01-25T14:00:00Z
checkpoints:
corpus-prep:
status: approved
approved_by: human
timestamp: 2026-01-25T10:30:00Z
hll-encode:
status: pending_review
validate:
status: not_started
review:
status: not_started
Session Resumption¶
If a session is interrupted:
The system reads .mistaber-session.yaml and continues from the current phase.
Workflow Violations¶
The hook system prevents workflow violations:
| Violation | Prevention | Hook |
|---|---|---|
| Writing .lp without corpus approval | BLOCKS | phase-gate |
| Missing @makor in rules | BLOCKS | encoding-guard |
| Unknown predicate | BLOCKS | encoding-guard |
| Commit without validation | BLOCKS | git-commit-guard |
| Commit without review | BLOCKS | git-commit-guard |
| Skip checkpoint | WARNS | checkpoint-enforcement |
Work Unit: Single Seif¶
The encoding pipeline works on one seif at a time:
Why Single Seif?
- Small enough for thorough human review
- Large enough to be meaningful
- Natural halachic unit
- Clear boundaries in source texts
- Tractable validation scope
Example Work Units:
| Reference | Topic |
|---|---|
| YD 87:1 | Beheima + Chalav (d'oraita) |
| YD 87:3 | Dag Bechalav (machloket) |
| YD 88:1 | Bitul Shishim |
| YD 89:1 | Waiting Period |
Handling Machloket¶
When encoding disputes:
- corpus-prep identifies all positions
- hll-encode creates:
- World-specific rules for each position
- Override mechanism for disagreements
machloket/4marker predicate- validate verifies both positions are derivable
- review presents side-by-side comparison
Machloket World Mapping¶
| Authority | World | Inherits From |
|---|---|---|
| All agree | base | - |
| Mechaber | mechaber | base |
| Rema | rema | base |
| Gra | gra | base |
| Yalkut Yosef | sefardi_yo | mechaber |
| Mishnah Berurah | ashk_mb | rema |
| Aruch HaShulchan | ashk_ah | rema, gra |
Artifacts Summary¶
By Phase¶
| Phase | Human Review | Machine Artifacts |
|---|---|---|
| Corpus | corpus-report.md | corpus-sources.yaml |
| Encode | encoding-report.md | *.lp files |
| Validate | validation-report.md | test-scenarios.yaml |
| Review | review-package.md | - |
| Commit | - | git commit |
Artifact Locations¶
.mistaber-artifacts/ # Working (deleted after commit)
docs/encoding-sessions/ # Archive (permanent)
mistaber/ontology/corpus/ # Final ontology files
mistaber/ontology/worlds/ # World-specific rules
mistaber/ontology/tests/ # Test files
Best Practices¶
Before Starting¶
- Verify prerequisites:
- Sefaria MCP available
- Mistaber engine working
-
Clingo installed
-
Choose work unit carefully:
- Start with simpler seifim
- Consider dependencies
- Check complexity score
During Encoding¶
- Take time at checkpoints:
- Don't rush approvals
- Review thoroughly
-
Ask clarifying questions
-
Answer all questions:
- Corpus questions require resolution
-
Document decisions
-
Test interactively:
- Use review phase testing
- Verify expected behavior
After Encoding¶
- Verify commit:
- Check git log
-
Review files committed
-
Plan next encoding:
- Follow suggested order
- Consider dependencies
Quick Reference¶
Trigger Phrases¶
| Skill | Triggers |
|---|---|
| corpus-prep | "prepare corpus", "fetch sources", "start encoding" |
| hll-encode | "encode rules", "write HLL", "create ASP" |
| validate | "validate", "run tests", "compile rules" |
| review | "review", "prepare review", "final review" |
| commit | "commit", "finalize", "save encoding" |
| workflow-guide | "how does encoding work", "workflow help" |
Command Quick Reference¶
# Start encoding
"Prepare corpus for YD {siman}:{seif}"
# Approve checkpoint
"Approved"
# Request changes
"Needs revision: [feedback]"
# Resume session
"Resume encoding YD {siman}:{seif}"
# Get workflow help
"What is the encoding workflow?"
Related Documentation¶
- Corpus Preparation - Phase 1 details
- HLL Encoding - Phase 2 details
- Validation - Phase 3 details
- Review - Phase 4 details
- Commit - Phase 5 details
- Troubleshooting - Error resolution