Repository navigation
feat(playbooks): add workspace library and authoring flow - #250
Conversation
4a0db7b to
2379f30
Compare
2379f30 to
18c8410
Compare
bryantderosier
left a comment
There was a problem hiding this comment.
Review of the library and authoring flow. No correctness defects turned up; the inline comments are about quality, duplicated sources of truth, and fork placement.
Open question I want settled before merge: web and mobile have two different create-playbook flows. Web launches the Playbook Author persona, while mobile (#251) opens a plain draft with CREATE_PLAYBOOK_PROMPT, which web never uses. I lean toward one flow on both surfaces. If the split is intentional, say why in the body.
The before/after screenshots are still needed here as well. SettingsSidebarNav.tsx and settingsSearch.ts also need FORK.md ledger rows.
|
|
||
| export function PlaybookLibrarySettings() { | ||
| const { environments } = useEnvironments(); | ||
| const workspaces = playbookWorkspaces(useProjects(), useThreadShells()); |
There was a problem hiding this comment.
playbookWorkspaces(useProjects(), useThreadShells()) isn't memoized and subscribes to every thread shell, so any agent activity (status or updatedAt changes) re-renders the whole settings page. Please useMemo it and select only the worktree fields it needs.
| @@ -0,0 +1,20 @@ | |||
| export const PLAYBOOK_IMPORT_MAX_BYTES = 262144; | |||
There was a problem hiding this comment.
This is a second copy of the server's size limit and name pattern. Please import both from packages/contracts/src/j5/playbook.ts (see my comment on PlaybookStore.ts in #248).
| reordering existing steps: active runs track identity by ID. Use 1–100 steps, YAML | ||
| 1.2 without aliases, and a file no larger than 256 KiB. Express tasks as prompts | ||
| for the same agent. This format has ordered steps; executable phases, personas, | ||
| transition graphs, and the older `t3-playbook/v1` schema belong to a different engine. |
There was a problem hiding this comment.
This skill is contributor tooling, since it only exists inside a j5code checkout. A user's workspace never has it, so the author prompt's "use the j5-new-playbook skill if available" always falls back to PLAYBOOK_AUTHOR_INSTRUCTIONS. That leaves two copies of the format rules to drift apart (the limits are already worded differently). This line also references an "older t3-playbook/v1 schema" and a "different engine" that don't exist on j5/main.
Please drop the skill and the prompt reference and keep the persona instructions as the single source, or ship it as product content. Also remove it from the FORK case 38 integration list.
| title: Report | ||
| prompt: Summarize findings, checks performed, and remaining uncertainty. | ||
|
|
||
| Each prompt tells the same agent what work to do, what evidence to retain, and when to advance. Use this flat step format; phases, edges, executable commands, and per-step persona assignments belong to a different playbook model. |
There was a problem hiding this comment.
"phases, edges, executable commands, and per-step persona assignments belong to a different playbook model". No such model exists on j5/main, so this confuses the agent more than it helps. Please remove it. The same goes for "phases" at lines 23 and 38: the format has steps, not phases.
| import type { EnvironmentProject, EnvironmentThreadShell } from "../state/shell.ts"; | ||
|
|
||
| export const CREATE_PLAYBOOK_PROMPT = | ||
| "Help me create an agent-led playbook in this workspace. Use the j5-new-playbook skill if available; otherwise follow your playbook authoring instructions. Ask what I want to accomplish, write .j5/playbooks/<name>.yaml, and validate it with playbook_list. Create the definition without starting a run."; |
There was a problem hiding this comment.
This references the contributor-only j5-new-playbook skill (see the SKILL.md comment), and the prompt is only used by mobile, while web launches Playbook Author. Please drop the skill reference, and make this match whichever single create flow we keep.
| @@ -136,6 +137,71 @@ const makeSupervisor = Effect.fn("TestEnvironmentCommands.makeSupervisor")(funct | |||
| }); | |||
|
|
|||
| describe("V2 environment commands", () => { | |||
| it.effect( | |||
| "launches Playbook Author with its Squadron and exact workspace in the wire request", | |||
There was a problem hiding this comment.
This J5 case lands in an upstream-owned test file. The persona stack's precedent keeps J5 cases in J5 test files and leaves the upstream test untouched. Please move it to packages/client-runtime/src/j5/playbooks.test.ts.
| @@ -76,6 +77,7 @@ const SETTINGS_SECTION_ICONS: Readonly< | |||
| "/settings/appearance": PaletteIcon, | |||
| "/settings/keybindings": KeyboardIcon, | |||
| "/settings/personas": UsersRoundIcon, | |||
| "/settings/playbooks": BookOpenIcon, | |||
There was a problem hiding this comment.
This adds a new Settings section in upstream files: a route, this nav entry, and settingsSearch.ts paths and items. Per my fork rule, please mount the playbook library inside an existing J5-owned surface instead. A Playbooks panel in Settings → Personas fits, since that already hosts the Playbook Author persona. That drops the upstream settings edits to zero. If a separate section is really the right call, argue for it in the PR body so we can sign off explicitly.
| Choose its **Authoring Squadron** when several Squadrons use the same project. | ||
| The persona is added to that environment on first use; customize its instructions | ||
| and model in **Settings → Personas**. It currently requires an authenticated Codex | ||
| provider because authoring needs Workspace write authority. Return to the library and refresh after |
There was a problem hiding this comment.
The user doc walks through buttons ("Create playbook", "Prepare playbook chat", "Import YAML", "refresh after creation") and uses internal jargon ("Workspace write authority"). The Codex-only limit is real, so please keep it but phrase it as "Playbook Author runs on Codex", and cut the button tour down to what the user needs to decide.
e443a7c to
f16891c
Compare
90b605c to
a77df7f
Compare
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reached
This review includes 10 billable files and costs up to $2.50. Or wait 59 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: Jacksondr5/j5code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between a77df7f4cb8423e8542be3f6db68d409e397bbd7 and fdefe34. 📒 Files selected for processing (10)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Jacksondr5/j5code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between bf941d467d58ecb2c4e758a0c999440bad086f77 and a77df7f4cb8423e8542be3f6db68d409e397bbd7. 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdds a Playbook library to the Personas settings page. The library selects project or thread workspaces, launches Playbook Author with a workspace-matched Squadron, imports and manages YAML definitions, and prepares playbook chats without replacing existing draft text. ChangesPlaybook library and authoring
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant User
participant PlaybookLibrarySettings
participant playbookAuthorLaunch
participant StartThreadTurn
participant WorkspaceThreadList
User->>PlaybookLibrarySettings: Select workspace and Squadron
PlaybookLibrarySettings->>playbookAuthorLaunch: Build workspace-bound launch
playbookAuthorLaunch-->>PlaybookLibrarySettings: Return launch input
PlaybookLibrarySettings->>StartThreadTurn: Start author turn
WorkspaceThreadList-->>PlaybookLibrarySettings: Show created thread
PlaybookLibrarySettings->>User: Navigate to thread
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No confirmed issue currently blocks the Playbook library change. Normal validation can proceed before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 8 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
a77df7f to
75517aa
Compare
a80421c to
0b12045
Compare
0b12045 to
fdefe34
Compare
Carried from j5/main 785db54 onto the upstream V2 candidate. Conflict: FORK.md only; case 45 takes the PR's library/authoring sentence and step-board wording. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Joins fork head 2cf4ad7 (j5/main, including #247, #241, #244, #242, #214, #215, #216, #248, #249, #250, #251) with the reviewed candidate (j5/upstream-sync-20260924-candidate), which descends from frozen upstream 67a2be0. Upstream force-rewrote history, so per FORK.md's rewrite runbook the candidate was built from the upstream tree with pin 62aef85 as the content base, then carried each j5/main PR since 8f56083 onto it and adapted it to upstream V2. This merge's tree equals the candidate tree exactly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Changed
Settings → Personas now includes a Playbooks library for project and thread worktree definitions. Users can import, rename, and delete YAML definitions or start a Playbook Author conversation in the selected workspace and Squadron.
Part 3 of 4 for #194. Base:
codex/agent-led-pb-02-runs.Review Follow-up
The library observes only workspace fields, so thread status updates do not repaint the settings panel. Import and server reads share the name pattern and 256 KiB limit from J5 contracts. Playbook Author instructions are the single source for authoring guidance; the checkout-only skill and obsolete model references are gone. The J5 launch assertion lives in the J5 test file. The library mounts in the existing Personas settings surface, leaving upstream settings navigation and search files unchanged.
Web and mobile now use the same Playbook Author launch with explicit workspace and Squadron ownership; the mobile change is in #251. Prepared start drafts still preserve existing text and attachments.
Validation
62 focused playbook, import, and server tests passed across three files after restacking on #249. Web and client-runtime typechecks passed after restacking; server typecheck, formatting, and diff checks passed for the review change.
UI Evidence
UI evidence remains pending at the developer's direction.
Created with GPT-6 in Codex.
Summary by CodeRabbit