# Tech-Realm/pack-protocol as a LogicPacks pack

Pack Protocol repo provides a Python spec, conformance suite, and reference reader for deterministic, shareable agentic code packs.

Source: https://github.com/Tech-Realm/pack-protocol at commit `55e71e5a54c3`. No account needed. Everything below runs on this machine with your own agent.
A digest tells an agent what the code is; a pack also gives it the keys, the rules and the purpose to work on it safely.

## Keys this app needs

| Key | Needed | Service | Without a key |
|---|---|---|---|
| `OPENAI_API_KEY` | required | openai | local mock |
| `STRIPE_SECRET_KEY` | required | stripe | local mock |
| `STRIPE_WEBHOOK_SECRET` | required | stripe | local mock |

Ask the person for these keys first. With real keys the app runs against the real services (keys stay in the local LogicPacks vault,
the app sees placeholders). Without them it runs against a local, stateful mock with demo data.

## Run it locally

```sh
uvx logicpacks@latest add github.com/Tech-Realm/pack-protocol --clone   # or: pipx run logicpacks add ...  (Python 3.9+)
cd pack-protocol
# real keys (optional, hidden prompt, stored only in the local vault):  uvx logicpacks@latest key add <KEY_NAME>
./lp-mock.sh &                                    # local stateful mock for keys you don't have
./lp-run.sh <the repo's dev command>              # see LOGICPACKS.md in the clone for the exact commands
```

`logicpacks add --clone` clones the repo, writes `.env.lp` (mock keys and placeholders, never real values), points the SDKs at the
local mock (base-URL env vars, and hardcoded API URLs in the local copy only), and writes `LOGICPACKS.md` (purpose, commands,
playbooks, rules). Re-run it after adding real keys.

## More

- Purpose and how it works: https://logicpacks.io/Tech-Realm/pack-protocol (tab "Purpose & rebuild")
- Full digest (tree + files, token-counted): https://convert.logicpacks.io/api/snapshots/s65ef3799bb0/digest.txt
- Pack files as JSON: https://convert.logicpacks.io/api/repo/Tech-Realm/pack-protocol/bundle
- The owner can add private files, env and logs, and share access: open https://logicpacks.io/Tech-Realm/pack-protocol in a browser.

## Add a contributor (owner, one step)

`uvx logicpacks@latest invite <github-user> --repo Tech-Realm/pack-protocol` on the owner's machine: GitHub collaborator invite with the owner's
own gh login (LogicPacks never holds a GitHub token), this pack, optional scoped keys (expiry, endpoints, limits; values stay
on the owner's machine) and an access link the contributor's agent verifies. `uvx logicpacks@latest offboard <github-user>`
removes all of it (logicpacks 1.0.22 or newer). Details: https://logicpacks.io/Tech-Realm/pack-protocol/invite.md

## Edit this app (make your own flavour)

`uvx logicpacks@latest remix github.com/Tech-Realm/pack-protocol` forks it to the user's GitHub (their own gh login), clones it, builds this pack
on local mocks and adds a "Remixed from Tech-Realm/pack-protocol" credit line. The owner's keys are never shared: live services use the user's own
keys. Licence and remix count: https://logicpacks.io/Tech-Realm/pack-protocol/edit.md

## Core logic and purpose

- Implements the Pack Protocol spec for deterministic sharing of agentic codebases.
- Provides a conformance test suite to validate packs, spaces, workflows, and registries.
- Supplies a reference pack reader that parses pack definitions and computes verification levels.
- Includes example packs (valid and invalid) and Super Skills validation tools.
- Main flow: run `conformance/run.py` on a space or repo → validates structure against schemas → runs outcome checks → reports compliance; optionally query a registry or check Super Skills.
- Key modules:
  * `conformance/` – test runner, JSON schema lite validator, Super Skills checker.
  * `reference/packreader.py` – minimal parser for pack YAML files, level computation.
  * `examples/` – sample pack directories used by tests.
  * `schemas/` – JSON Schemas for all protocol files.
  * `openapi.json` – registry API definition.
