Skip to content

feat: add playbook-library end-user CLI#9

Merged
KyleAMathews merged 8 commits into
mainfrom
feat/playbook-library-cli
Mar 3, 2026
Merged

feat: add playbook-library end-user CLI#9
KyleAMathews merged 8 commits into
mainfrom
feat/playbook-library-cli

Conversation

@KyleAMathews
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new playbook-library bin to @tanstack/playbooks — a lean end-user CLI separate from the existing maintainer CLI
  • Libraries (e.g. @tanstack/router) wire it up by running playbook setup --shim, which generates a bin/playbook.js shim they commit and expose as their own playbook bin entry
  • When a consumer runs playbook list, the CLI walks up from the shim's path to detect the home package, then recursively traverses dependencies + peerDependencies looking for other packages with bin.playbook, collecting and printing skills from each
  • playbook install prints an agent-driven prompt (like scaffold) that maps skills to project tasks and writes a <!-- playbook-skills:start/end --> block into CLAUDE.md

New files

  • src/library-scanner.ts — recursive dep traversal + skill discovery, testable via optional projectRoot param
  • src/playbook-library.tslist and install commands
  • tests/library-scanner.test.ts — 9 tests covering skill data, recursive traversal, peerDeps, cycle detection, sub-skills, and error cases

Changes

  • src/setup.ts — new --shim flag (on by default) generates bin/playbook.js shim with instructions
  • package.jsonplaybook-library bin entry, ./playbook-library subpath export, updated build script

Test plan

  • pnpm build completes cleanly
  • pnpm test:lib — all 127 tests pass
  • node dist/playbook-library.mjs list prints home package + skills
  • node dist/playbook-library.mjs install prints agent prompt and copies to clipboard
  • playbook setup --shim generates bin/playbook.js with correct content

🤖 Generated with Claude Code

Introduces a separate CLI entry point for library consumers (distinct from
the maintainer CLI). Libraries wire it up via a generated shim so coding
agents can discover and load skills on demand.

- `playbook list` — recursively traverses deps/peerDeps with bin.playbook,
  prints each package's skills with name, description, and full path
- `playbook install` — agent-driven prompt that maps skills to project tasks,
  writing a <!-- playbook-skills:start/end --> block into CLAUDE.md
- `playbook setup --shim` — generates bin/playbook.js shim in the library
  package and prints instructions to wire up the bin entry
- 9 tests covering skill discovery, recursive traversal, cycle detection,
  peerDeps, missing skills dir, and error cases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 2, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/playbooks@9

commit: f3cc850

KyleAMathews and others added 7 commits March 2, 2026 16:31
autofix.yml runs `pnpm generate-docs` but the script was never wired up,
causing CI to fail with ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
autofix.ci bans modifications to .github, but pnpm run format was
reformatting workflow YAMLs and staging those changes for commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The validate-skills workflow triggered (via autofix.ci reformatting the
script) but this repo has no root-level skills/ dir — it's the toolkit,
not a library. Exiting 0 with a message is the right behavior when there's
nothing to validate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot mentioned this pull request Mar 2, 2026
@KyleAMathews KyleAMathews merged commit c0c7cab into main Mar 3, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 3, 2026
@LadyBluenotes LadyBluenotes deleted the feat/playbook-library-cli branch March 16, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant