From a9d6019c1de3ddffeab4389278bfd848ebf81022 Mon Sep 17 00:00:00 2001 From: Sungman Cho Date: Thu, 26 Mar 2026 14:40:07 -0700 Subject: [PATCH 1/2] fix(plugin): dispatch bp-analyze as Agent from setup to avoid rate limits The setup wizard's "Run bp analyze now" option previously invoked bp-analyze as an inline skill, which inherited the setup session's accumulated context and hit rate limits. Now dispatches it as an isolated Agent with a clean context, consistent with how the orchestrator dispatches its own stages. Also removes the misleading "Queue for next session" option since direct execution is now safe. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/plugin/skills/bp-setup/SKILL.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/plugin/skills/bp-setup/SKILL.md b/packages/plugin/skills/bp-setup/SKILL.md index 5d401d59..1805d808 100644 --- a/packages/plugin/skills/bp-setup/SKILL.md +++ b/packages/plugin/skills/bp-setup/SKILL.md @@ -162,9 +162,8 @@ Then ask the user what they would like to do next. If the user already said to continue working or to run analysis now, follow that instruction directly and do not call `AskUserQuestion`. Use `AskUserQuestion` with these options: -- **"Queue bp analyze for next session"** (Recommended) — call `save_user_prefs` with `{ "queueAnalysis": true }` so the analysis auto-starts in the next session with a fresh rate-limit budget. Tell the user: "Analysis queued! It will start automatically in your next Claude Code session." -- **"Run bp analyze now"** — warn the user: "Running analysis immediately after setup may hit API rate limits. If it fails, just start a new session and it will auto-resume." Then invoke the `bp-analyze` skill. -- **"Continue working"** — call `save_user_prefs` with `{ "queueAnalysis": true }` so analysis starts in a future session, then exit the wizard +- **"Run bp analyze now"** (Recommended) — dispatch `bp-analyze` as an **Agent** (not as an inline skill). Use the Agent tool with `model: sonnet`, prompt: `"Read the skill instructions at [PLUGIN_PATH]/skills/bp-analyze/SKILL.md and follow them exactly. You have access to BetterPrompt MCP tools. Execute the complete analysis workflow."`, description: `"bp: analyze"`. This ensures the orchestrator starts with a clean context and avoids inheriting the setup session's token budget. +- **"Continue working"** — call `save_user_prefs` with `{ "queueAnalysis": true }` so analysis auto-starts in a future session, then exit the wizard ### Step 7: Complete From 33a964bd3c0c015c18ddc88b36dd00d1e534560a Mon Sep 17 00:00:00 2001 From: Sungman Cho Date: Thu, 26 Mar 2026 14:42:21 -0700 Subject: [PATCH 2/2] fix(plugin): add PLUGIN_PATH resolution hint and structured Agent spec in bp-setup Address code review feedback: the LLM executing bp-setup had no way to resolve [PLUGIN_PATH] when dispatching bp-analyze as an Agent. Added explicit resolution path and restructured the Agent call as a code block for clarity. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/plugin/skills/bp-setup/SKILL.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugin/skills/bp-setup/SKILL.md b/packages/plugin/skills/bp-setup/SKILL.md index 1805d808..80bd41f3 100644 --- a/packages/plugin/skills/bp-setup/SKILL.md +++ b/packages/plugin/skills/bp-setup/SKILL.md @@ -162,7 +162,13 @@ Then ask the user what they would like to do next. If the user already said to continue working or to run analysis now, follow that instruction directly and do not call `AskUserQuestion`. Use `AskUserQuestion` with these options: -- **"Run bp analyze now"** (Recommended) — dispatch `bp-analyze` as an **Agent** (not as an inline skill). Use the Agent tool with `model: sonnet`, prompt: `"Read the skill instructions at [PLUGIN_PATH]/skills/bp-analyze/SKILL.md and follow them exactly. You have access to BetterPrompt MCP tools. Execute the complete analysis workflow."`, description: `"bp: analyze"`. This ensures the orchestrator starts with a clean context and avoids inheriting the setup session's token budget. +- **"Run bp analyze now"** (Recommended) — dispatch `bp-analyze` as an **Agent** (not as an inline skill) so it starts with a clean context. Use the Agent tool with: + ``` + model: sonnet + description: "bp: analyze" + prompt: "Read the skill instructions at [PLUGIN_PATH]/skills/bp-analyze/SKILL.md and follow them exactly. You have access to BetterPrompt MCP tools. Execute the complete analysis workflow." + ``` + To resolve `[PLUGIN_PATH]`: find the BetterPrompt plugin root by searching for the skills directory under `~/.claude/plugins/cache/betterprompt/`. - **"Continue working"** — call `save_user_prefs` with `{ "queueAnalysis": true }` so analysis auto-starts in a future session, then exit the wizard ### Step 7: Complete