Skip to main content

Patchouli Handbook

中文说明

Patchouli Handbook is a file-backed knowledge system for AI agents. It is inspired by skills, but it is intentionally thicker: a skill can trigger the right behavior, while a handbook can hold a full guide, routing map, reusable entries, glossary, source evidence, validation, and CRUD tooling.

Use it when an agent needs more than a short SOP: domain principles, decision rules, examples, anti-patterns, and source-grounded guidance that should be expanded progressively instead of loaded all at once.

What It Provides

  • A stable on-disk handbook format built from Markdown plus manifest.json.
  • A lightweight entry_skill/SKILL.md activation layer for skill-aware agents.
  • A thicker GUIDE.md operating manual for complex tasks.
  • Category and entry pages for progressive disclosure.
  • Optional evidence pages and source indexes for provenance.
  • A Python API and JSON CLI for creating, editing, validating, and inspecting handbooks.
  • A complete example handbook generated from public game-design source summaries.

Repository Layout

patchouli_handbook/   Python library and CLI
docs/                 Architecture, authoring, and agent protocol docs
example/              Example generated handbooks
tests/                Unit tests
pyproject.toml        Package metadata and console script

Handbook Layout

<handbook_dir>/
├── manifest.json
├── GUIDE.md
├── INDEX.md
├── entry_skill/
│   └── SKILL.md
├── categories/
│   └── <category_slug>/
│       ├── CATEGORY.md
│       └── <entry_slug>.md
├── references/
│   ├── glossary.md
│   └── source_index.md
└── evidence/
    └── <source_id>.md

Quick Start

uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e '.[dev]'

Python 3.10+ is supported.

Create a blank handbook:

patchouli-handbook init \
  --output output/studio-handbook \
  --title "Studio Handbook" \
  --audience "AI agents and studio maintainers"

Add content:

patchouli-handbook categories create \
  '{"title":"Planning","description":"Scoping, goals, and project framing."}' \
  --handbook output/studio-handbook

patchouli-handbook entries create \
  '{"title":"Scope First","category_slug":"planning","summary":"Decide the scope before choosing tactics."}' \
  --handbook output/studio-handbook

patchouli-handbook validate --handbook output/studio-handbook

Inspect the included example:

patchouli-handbook inspect --handbook example/masahiro-sakurai-on-creating-games
patchouli-handbook validate --handbook example/masahiro-sakurai-on-creating-games

Start reading the example at:

  • example/masahiro-sakurai-on-creating-games/GUIDE.md
  • example/masahiro-sakurai-on-creating-games/INDEX.md

CLI

Common commands:

patchouli-handbook structure
patchouli-handbook describe --handbook <handbook_dir>
patchouli-handbook validate --handbook <handbook_dir>
patchouli-handbook categories list --handbook <handbook_dir>
patchouli-handbook entries get <entry_slug> --handbook <handbook_dir>

Machine-readable integration point:

patchouli-handbook apply '{"action":"get_entry","slug":"scope-first"}' --handbook <handbook_dir>

apply accepts these actions:

  • describe
  • validate
  • list_categories
  • list_entries
  • get_category
  • get_entry
  • update_book
  • create_category
  • update_category
  • delete_category
  • create_entry
  • update_entry
  • delete_entry

CLI failures are emitted as JSON:

{
  "ok": false,
  "error": {
    "type": "KeyError",
    "message": "'Unknown entry: missing-entry'"
  }
}

Python API

from patchouli_handbook import HandbookStore, create_empty_handbook

create_empty_handbook(
    "output/studio-handbook",
    title="Studio Handbook",
    audience="AI agents and studio maintainers",
)

store = HandbookStore("output/studio-handbook")
store.create_category(
    {
        "title": "Planning",
        "description": "Scoping, goals, and project framing.",
    }
)
store.create_entry(
    {
        "title": "Scope First",
        "category_slug": "planning",
        "summary": "Decide the scope before choosing tactics.",
        "use_when": ["The task is broad or under-specified."],
        "do_this": ["Name the goal.", "Name constraints.", "Pick the smallest useful next step."],
        "checklist": ["The scope is explicit.", "The next action is concrete."],
        "anti_patterns": ["Do not choose tactics before defining the target."],
    }
)
print(store.validate().model_dump())

Build From Source Summaries

The builder can generate a handbook from a channel_extractor-style job directory containing:

  • channel.json
  • videos.json
  • clean/<video_id>.json

Example:

export OPENAI_API_KEY=...
patchouli-handbook build \
  --input path/to/channel-job \
  --output output/generated-handbook

The builder writes GUIDE.md, INDEX.md, category pages, entry pages, references, evidence pages, entry_skill/SKILL.md, and manifest.json.

Documentation

Included Example

example/masahiro-sakurai-on-creating-games demonstrates a generated handbook with:

  • 14 categories
  • 260 entries
  • 299 evidence pages
  • GUIDE.md plus a skill-compatible entry_skill/SKILL.md

The example is included to show the intended scale and navigation pattern of a thick handbook.

Test

pytest

Metadata

Release files for patchouli-handbook 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for patchouli-handbook 0.1.0
File Size Uploaded Provenance Actions
patchouli_handbook-0.1.0.tar.gz 35.0 kB With provenance Details for patchouli_handbook-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for patchouli-handbook 0.1.0
File Interpreter ABI Platform Actions
patchouli_handbook-0.1.0-py3-none-any.whl Python 3 none any Details for patchouli_handbook-0.1.0-py3-none-any.whl

Total release size: 64.2 kB

Release files / patchouli_handbook-0.1.0.tar.gz

Download URL patchouli_handbook-0.1.0.tar.gz
Size 35.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6f137e0000ce8132a29097e4ee318a7389228a958138e53fbdd1a4ef06ffa58b
BLAKE2b-256 checksum
How to use checksums
33b61c73e8d864cbb5cd29982cf10bcacb19f4b48db3848a50351b61cc45d46f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

Release files / patchouli_handbook-0.1.0-py3-none-any.whl

Download URL patchouli_handbook-0.1.0-py3-none-any.whl
Size 29.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbde8c7084cd5869361c3b75b984c5ca887270c9034ddd9273884eb87336d502
BLAKE2b-256 checksum
How to use checksums
38ce406f7d6ed8c7960ead91c4ad2926f56b45b42d05fe1ddb191285ad35aef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

Security for patchouli-handbook 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for patchouli_handbook-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page