Files
pad/internal
xarmian 9764b2fe92 docs: document playbook invocation surface (TASK-1387) (#525)
* docs: document playbook invocation surface (TASK-1387)

Closes out PLAN-1377 — Make Playbooks first-class invokable procedures —
by bringing the four user-facing docs surfaces up to date with the
shipped invocation model. The pad-web docs ship in a separate commit
(../pad-web@main: docs: document playbook invocation surface).

- CLAUDE.md — new Playbooks section after Data Model covering the
  three invocation surfaces, the invocation_slug/arguments schema
  fields, bootstrap-returns-metadata, the seeded ship playbook, the
  web UI editor, and a code map. MCP section grows pad_playbook,
  pad://workspace/{ws}/bootstrap, and the pad_set_workspace embedded
  response note.
- skills/pad/SKILL.md — adds a "Creating a playbook" subsection under
  natural-language routing with CLI examples for trigger-only and
  slug-invocable playbooks, plus a Playbooks block in the CLI
  reference (pad playbook list/show/run with parsing rules).
- README.md — one-line bump in the feature list mentioning the new
  /pad <slug> invocation form and the seeded ship playbook.

Parent: PLAN-1377.

* fix(docs): correct bootstrap route + CLI arguments authoring per Codex review (round 1)

Codex round 1 findings:

[P2] CLAUDE.md cited GET /api/v1/workspaces/{ws}/bootstrap but the
implemented route is /api/v1/workspaces/{ws}/agent/bootstrap (server.go
line 1182). Documented endpoint would 404 for HTTP integrators.

[P2] SKILL.md '--field arguments=[...]' example would fail validation
— pad item create stores all --field values as strings, while
arguments is a json field type. Rewrote the slug-invocable-playbook
authoring guidance to direct agents at the web UI editor for
structured argument authoring (the canonical path the editor was
built for) with the CLI handling everything else. Same fix applied
to the pad-web /docs/agent-integration page in a separate
../pad-web@main commit.

Parent: TASK-1387 / PLAN-1377.

* fix(docs): use full /{username}/{workspace}/playbooks route in SKILL.md per Codex review (round 2)

Codex round 2 finding:

[P3] SKILL.md's recommended web editor path was '/{workspace}/playbooks',
but the SvelteKit route is '/{username}/{workspace}/playbooks'. The
prior path would 404 or land on the wrong workspace. Fixed.

The pad-web docs ship the matching fix in a separate commit at
../pad-web@main: docs(playbooks): use full /{username}/{workspace}
route path per review.

Parent: TASK-1387 / PLAN-1377.

* fix(docs): bump CLAUDE.md MCP tool surface to v0.3 + close SKILL.md backtick per Codex review (round 3)

Codex round 3 findings:

[P2] CLAUDE.md still labelled the tool surface as v0.2; internal/mcp/
version.go advertises ToolSurfaceVersion = '0.3' (since PLAN-1377 /
TASK-1380). Updated to v0.3 and added a note about what v0.3 introduced
(pad_meta.action: bootstrap, pad_set_workspace embedded-bootstrap
response, pad://workspace/{ws}/bootstrap resource).

[P3] SKILL.md's web-editor route had the parenthetical inside the
code span: '`/{username}/{workspace}/playbooks (click "+ New
Playbook")`' — closed the backtick after '/playbooks' so the
rendered code span is the literal path.

The pad-web docs ship the matching v0.3 bump in a separate commit at
../pad-web@main: docs(mcp/tools): bump tool surface to v0.3.

Parent: TASK-1387 / PLAN-1377.

* fix(docs): bump stale MCP catalog references to v0.3 per Codex review (round 4)

Codex round 4 finding [P2]:

Three places still described the MCP catalog as v0.2, contradicting the
v0.3 surface block that landed in this PR:

- CLAUDE.md 'MCP server' lede paragraph — bumped to v0.3, added
  pad_playbook to the listed tools, and noted what v0.3 introduced.
- skills/pad/SKILL.md MCP note for MCP-using agents — bumped to v0.3,
  added pad_playbook to the listed tools and called out the playbook
  invocation surface + bootstrap action.
- README.md 'Tool catalog (v0.2)' block — bumped to v0.3, added the
  pad_playbook row, the pad_meta.action: bootstrap row, the bootstrap
  resource, and bumped tool_surface_version.

Parent: TASK-1387 / PLAN-1377.

* fix(docs): bump MCP server-side self-description to v0.3 per Codex review (round 5)

Codex round 5 finding [P2]:

Two MCP-server-internal documentation surfaces still advertised v0.2:

- internal/mcp/instructions.md — the markdown blob the server returns
  to MCP clients as initialization instructions. Updated 'Tool surface
  (v0.2) / Eight tools' to 'Tool surface (v0.3) / Nine tools', added
  pad_playbook with list/get/run, added bootstrap to pad_meta's actions,
  noted pad_set_workspace's embedded-bootstrap response, and added
  pad://workspace/{ws}/bootstrap to the resource list.
- internal/mcp/catalog_meta.go — the pad_meta tool's Description string
  said 'v0.2 tool catalog' twice. Bumped both to v0.3.

These ship inside the binary; MCP clients read them directly so v0.2
mentions there contradict the v0.3 catalog the handshake actually
advertises (ToolSurfaceVersion in version.go).

Parent: TASK-1387 / PLAN-1377.

* fix(docs): finish MCP self-description v0.3 cleanup per Codex review (round 6)

Codex round 6 findings [P3]:

[1] catalog_meta.go's padMetaTool block-comment said 'Three actions,
all handled inline' even though bootstrap (the v0.3 fourth action)
dispatches through env.Dispatch. Fixed both the count and the
dispatch description, added the bootstrap row to the action list.
Also corrected the v0.2 mentions in actionMetaToolSurface's comment
and removed the rollout-era language now that the cmdhelp walker is
retired.

[2] instructions.md said 'Nine tools, each with an action enum' but
pad_set_workspace doesn't take an action. Clarified the count as
'eight resource × action tools, plus pad_set_workspace (which takes
a workspace slug only)' and scoped the 'Always pass action' rule to
the eight resource × action tools.

Parent: TASK-1387 / PLAN-1377.

* fix(docs): finish MCP self-description nine-tool wording per Codex review (round 7)

Codex round 7 findings:

[1] catalog_meta.go's padMetaToolDescription still mentioned the
PLAN-969-rollout cmdhelp walker contributing to tools/list. The walker
was retired in TASK-981. Rewrote the tool-surface action description
to match current behavior and explicitly note pad_set_workspace is
registered separately (not enumerated by tool-surface).

[2] actionMetaToolSurface's comment claimed scope includes
pad_set_workspace; the impl only loops env.Catalog. Updated the
comment to be accurate — tool-surface enumerates the eight catalog
tools only, callers should account for pad_set_workspace as a known
extra.

[3] CLAUDE.md and README.md described the MCP surface as if every
listed tool was resource × action. pad_set_workspace takes
'workspace' only. Reworded both to match instructions.md's
'eight resource × action tools plus pad_set_workspace' framing.

Parent: TASK-1387 / PLAN-1377.
2026-05-12 21:44:45 -04:00
..
2026-03-26 01:52:36 +00:00