Repository navigation
Parts Accounts and Folders
Besides flows, the store holds three shared libraries. Each document is one JSON file:
| Collection | Folder | What it holds |
|---|---|---|
| parts | playbook/store/parts/ |
Reusable steps, written once and followed by any number of flows |
| accounts | playbook/store/accounts/ |
The accounts registry: which handles the agent may use, and how |
| folders | playbook/store/folders/ |
Shared folders and key files that steps point at |
They follow the same rules as flows: one id rule, schema checks on every save, a version kept for every change, a reason for every delete.
A part is a step written once. The demo has six:
$ python playbook/pb.py parts
[RULE] Strip EXIF and GPS | Before a phone photo is uploaded (part-exif) used by: art
[STEP] Log it | audit.py add, then update --verified (part-log) used by: audit, bluesky, reddit, x-post, x-reply
[TOOL] Own browser tab | Agent name, tab_id on every call (part-own-tab) used by: x
[QC] QC the draft | qc.py check before every send (part-qc-check) used by: bluesky, qc, reddit, x-post, x-reply
[QC] Read the composer back | Before Post, Share, Publish or Schedule (part-read-back) used by: reddit, x-post, x-reply
[QC] Verify it's live | Check the live page or API before saying done (part-verify-live) used by: audit, x-post
A part has the content fields of a node and none of the position fields:
| Field | Notes |
|---|---|
kind |
Required. Any of the ten node kinds. |
title |
Required, 80 characters |
sub, body, checks
|
As on a node (120, 1200, 12 items of 200) |
folders, links
|
Added to the folders and links of every node that references it |
goto, account
|
Only for a goto part or an account part |
src, origin
|
Provenance; not printed by pb.py show
|
editedAt, updatedAt
|
Timestamps |
The id starts with part-.
A node that follows a part stores only the reference and its position:
{"id": "cl-qc", "part": "part-qc-check", "x": 680, "y": 0}It may also carry its own folders, links, src, origin and editedAt, but not kind, title, sub,
body, checks, goto or account: those come from the part, and the schema refuses them on the node.
pb.py show prints the node with the part's text filled in, and pb.py show <flow> --json includes a
resolved copy of the flow with every reference filled in.
On the canvas: Add, then From the parts library; Swap part on a node (keeps its connections); Save as part on a node (saves the part and makes the node follow it); Edit part from any node that follows it; Detach to copy the text into the node and stop following.
When the same steps appear in two or more flows. The demo's QC check, read-back, logging and live-check steps are
parts, so changing how drafts are checked means editing one part, not five flows. The lint rule part-copy
warns when a node repeats a part's title instead of referencing it.
On the canvas, deleting a part asks for a reason and first gives every step that followed it a copy of its text.
pb.py delete parts <id> --reason "..." does not: it lists every node that still references the part, and those
nodes are dangling-ref errors in pb.py check until you detach or remove them.
The registry of accounts the agent may use. Handles only: never passwords, recovery codes, tokens or email
addresses. pb.py check warns (email) when an account contains an email address.
$ python playbook/pb.py accounts x
X @acmenotes_demo active flow=x
Release news, tips and replies about Acme Notes.
pacing: About 2 replies per person a day; 1 to 3 originals.
- Demo account: replace it with your own in the canvas Accounts panel.
| Field | Limit | What it is |
|---|---|---|
platform |
required, one of the list below | The platform |
handle |
60, one line | The handle as the platform shows it (@name, name.bsky.social, u/name) |
label |
60, one line | A readable name ("The main account"). An account needs a handle or a label. |
owner |
40 | Whose account it is. A single capitalised first name here also feeds the owner-name lint rule. |
status |
required |
active, replies-only, paused, retired or skip. Nothing can be logged from a retired or skip account (see below). |
flow |
a flow id, or empty | The platform flow that works this account. The flow's top bar lists its accounts. |
purpose |
300 | What the account is for |
pacing |
200 | Its caps and rhythm, in words |
login |
200 | How it signs in ("the owner signs in", "Google sign-in"). Never a secret. |
url |
500, http or https | The profile link |
projects |
up to 10 flow ids | The project flows this account speaks for |
notes |
up to 20 lines of 300 | Anything else: subreddits, groups, quirks |
src, origin
|
Provenance | |
editedAt, updatedAt
|
Timestamps |
Platforms: X, Bluesky, Threads, LinkedIn, Facebook, Facebook group, Instagram, TikTok,
YouTube, Reddit, DEV, Medium, Hashnode, GitHub, Hacker News, Product Hunt, Contra, Upwork,
Gmail, other.
-
audit.py addandaudit.py gaprefuse an--accountthat isn't a handle or label of an account on that platform, and an account whose status isretiredorskip("is marked retired in the accounts registry for Reddit: nothing goes out from it").add --forcelogs it anyway. AFacebook groupsend also accepts yourFacebooknames. A platform with no accounts in the registry isn't checked. -
qc.py checkruns the same test as theaccount-registryfilter, so a draft for the wrong account, or for a retired or skipped one, blocks before it is sent. -
The agent reads
pb.py accounts [platform]for the exact handles to use, and an account node in a flow names the account the flow works.
active, replies-only and paused all pass these checks; the difference between them is for you and the agent
to read in the flows. To stop an account being used, set it to retired (or skip), or delete it.
- Canvas: Accounts, then Add account, or Duplicate an existing one. The form never asks for a password; leave it that way.
- Command line: write the JSON and
python playbook/pb.py put accounts <id> account.json. - Canvas: Delete on the account's card asks for a reason. Steps that showed the account become ordinary steps and keep their text.
- Command line:
python playbook/pb.py delete accounts <id> --reason "why". It lists every flow node and account that still points at the deleted account; fix those, orpb.py checkreports them asdangling-referrors.
A folder record names a place on disk once, so any step can point at it and a path change is made in one place.
$ python playbook/pb.py folders
docs Drafts ~/AcmeNotes/drafts used by: onboard, release
images Art library ~/AcmeNotes/art used by: art
images Screenshots ~/AcmeNotes/assets/screenshots used by: art, onboard, release
playbook Post bank playbook/state/bank.tsv used by: x-post
| Field | Limit | What it is |
|---|---|---|
label |
required, 60 | The name shown on the canvas and in pb.py show
|
path |
required, 260 | A folder or a file |
kind |
required |
music, images, video, scripts, docs, playbook or other
|
note |
200 | What lives there, how files are named |
editedAt, updatedAt
|
Timestamps |
pb.py show prints a node's folders as label -> path, so the agent sees the real path.
The demo's ~/AcmeNotes/... paths are placeholders; point them at real folders on your machine. A path can be:
- absolute (
C:\Users\me\Pictures\app,/home/me/app/art); - relative to your home folder, starting with
~(~/AcmeNotes/art); - relative to the skill folder (
playbook/state/bank.tsv), which works on any machine the skill is installed on.
The canvas's "open in the file manager" button and pb.py check --paths both read paths this way. Open folder
only opens a path that exists, never opens a network share, and never runs anything; check --paths skips
network paths.
On the canvas, deleting a folder asks for a reason and removes it from every step that used it. The folder on
disk is never touched. pb.py delete folders <id> --reason "..." removes only the record and lists the steps that
still use it; they are dangling-ref errors until you remove the reference. The lint rule unused-folder warns about a folder
no step uses.
Agent Playbook is released under the MIT licence. Source: github.com/RandyNorthrup/agent-playbook