propresenter-php/AGENTS.md
Thorsten Bus b30918af41 feat(macros): add reader for global Macros file
Importer for ProPresenter's protobuf-encoded `Macros` document. Exposes
each macro's UUID and name plus the collections that group them.

- src/MacroLibrary.php: top-level wrapper indexed by UUID and name
- src/Macro.php, src/MacroCollection.php: per-entry wrappers
- src/MacrosFileReader.php: file -> MacroLibrary entry point
- bin/parse-macros.php: CLI listing macros and collections
- tests/MacrosFileReaderTest.php: 10 tests against reference sample
- doc/api/macros.md: API reference, plus INDEX/keywords updates
2026-05-03 20:38:47 +02:00

70 lines
2.4 KiB
Markdown

# ProPresenter Parser — Agent Instructions
## Documentation
All project documentation lives in `doc/`. Load only what you need.
**Start here:** Read `doc/INDEX.md` for the table of contents and quick navigation.
### How to Find What You Need
1. Check `doc/INDEX.md` for the topic overview
2. Use `doc/keywords.md` to search by keyword
3. Load the specific doc file — don't load everything
### Common Tasks
| Task | Load |
|------|------|
| Parse/modify `.pro` song files | `doc/api/song.md` |
| Parse/modify `.proplaylist` files | `doc/api/playlist.md` |
| Parse/modify `.probundle` files | `doc/api/bundle.md` |
| Read the global `Macros` file | `doc/api/macros.md` |
| Understand `.pro` binary format | `doc/formats/pp_song_spec.md` |
| Understand `.proplaylist` binary format | `doc/formats/pp_playlist_spec.md` |
| Understand `.probundle` binary format | `doc/formats/pp_bundle_spec.md` |
| Debug or troubleshoot | `doc/internal/issues.md` |
| Add new documentation | `doc/CONTRIBUTING.md` |
### Structure
```
doc/
├── INDEX.md ← Start here (TOC + navigation)
├── keywords.md ← Keyword search index
├── CONTRIBUTING.md ← How to document new things
├── formats/ ← Binary file format specs
│ ├── pp_song_spec.md
│ ├── pp_playlist_spec.md
│ └── pp_bundle_spec.md
├── api/ ← PHP API docs (read/write/generate)
│ ├── song.md
│ ├── playlist.md
│ └── bundle.md
└── internal/ ← Dev notes (learnings, decisions, issues)
├── learnings.md
├── decisions.md
└── issues.md
```
## Project Overview
PHP tools for parsing, modifying, and generating ProPresenter 7 files:
- **Songs** (`.pro`) — Protobuf-encoded presentation files with lyrics, groups, slides, arrangements, translations
- **Playlists** (`.proplaylist`) — ZIP64 archives containing playlist metadata and embedded songs
- **Bundles** (`.probundle`) — ZIP archives containing a single presentation with embedded media assets
- **Macros** (`Macros`, no extension) — Global protobuf-encoded macro library with collections
### CLI Tools
```bash
php bin/parse-song.php path/to/song.pro
php bin/parse-playlist.php path/to/playlist.proplaylist
php bin/parse-macros.php path/to/Macros
```
### Key Source Files
All PHP source code is in `src/`. Generated protobuf classes are in `generated/`. Tests are in `tests/`.