UnifyWeaver

UnifyWeaver Playbooks

This directory contains concrete,executable playbooks for common UnifyWeaver tasks. Each playbook provides step-by-step instructions that AI agents (or humans!) can follow to accomplish specific goals.

What are Playbooks?

Playbooks are detailed execution guides that provide:

Think of them as recipes that ensure consistent, repeatable results.

Available Playbooks

Beginner Level

Factorial Compilation

Goal: Compile a factorial predicate from Prolog to Bash Time: ~5 minutes Prerequisites: SWI-Prolog, UnifyWeaver Pattern: Linear recursion

Perfect introduction to UnifyWeaver’s compilation pipeline. Demonstrates:

When to use: Learning the basics, testing your UnifyWeaver installation


Intermediate Level

GNU Prolog Native Binary Compilation

Goal: Generate and compile a native GNU Prolog executable Time: ~10 minutes Prerequisites: SWI-Prolog, UnifyWeaver, GNU Prolog, gplc Pattern: Prolog-to-Prolog transpilation with native compilation

Demonstrates the Prolog target with compilation to standalone binaries. Shows:

When to use: Deploying standalone executables, learning Prolog target

Related: Book: Prolog Target


Coming Soon

Planned Playbooks

How to Use This Directory

For Learners

  1. Start with factorial_compilation.md - Foundational concepts
  2. Progress to gnu_prolog_compilation.md - Advanced features
  3. Try modifying the examples - Change predicates, targets, options
  4. Create your own playbooks - Follow the format specification

For AI Agents

  1. Read the playbook sequentially - Follow steps in order
  2. Execute verification commands - Confirm each step succeeded
  3. Check success criteria - Ensure all criteria met
  4. Use troubleshooting section - Handle errors gracefully
  5. Report progress - Log what you’re doing

For Instructors

  1. Use as teaching materials - Step-by-step learning
  2. Assign as exercises - Students execute playbooks
  3. Create variations - Modify for different learning objectives
  4. Build on examples - Reference in your own materials

Playbook Quality Standards

All playbooks in this directory should:

Creating New Playbooks

Want to contribute a playbook?

  1. Use the template from playbook_format.md
  2. Fill in all sections:
    • Frontmatter with metadata
    • Clear goal statement
    • Context and assumptions
    • Step-by-step execution
    • Expected outputs
    • Verification procedures
    • Troubleshooting guide
  3. Test thoroughly - Execute every command
  4. Get feedback - Have someone else try it
  5. Submit PR - Add to this directory

Playbook Naming Convention

Files should be named: <task>_<subtask>.md

Examples:

IDs in frontmatter: playbook-<task>-<subtask>-v<version>

Example: playbook-factorial-compilation-v1

Difficulty Levels

Beginner:

Intermediate:

Advanced:

Success Metrics

A good playbook should have:

Maintenance

Playbooks should be updated when:

Version history should be documented at the end of each playbook.


Directory Status: Active Last Updated: 2025-11-17 Playbook Count: 2 (2 published, 6 planned)

Let’s build comprehensive, reliable playbooks that make UnifyWeaver accessible to everyone! 🚀