From 932630cdb2d5f915e1188f5024d3edc04fe2ae6b Mon Sep 17 00:00:00 2001 From: HiranoMasaaki Date: Sat, 3 Jan 2026 07:33:30 +0000 Subject: [PATCH 1/2] refactor(create-expert): clarify context passing mechanism between delegates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make explicit that context is passed via query (not shared state) since Perstack delegates only receive the query - no message history or parent context. Changes to CREATE_EXPERT_INSTRUCTION: - Add "Context Passing" section explaining the mechanism - Specify what context to include for each delegate - Replace procedural workflow with declarative delegates list Changes to REPORT_GENERATOR_INSTRUCTION: - Clarify that input comes from the query - Explain what the coordinator provides This aligns with Perstack's context isolation design documented in docs/understanding-perstack/experts.md. Closes #382 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../src/lib/create-expert-toml.ts | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/apps/create-expert/src/lib/create-expert-toml.ts b/apps/create-expert/src/lib/create-expert-toml.ts index c3a09533..be15ebe6 100644 --- a/apps/create-expert/src/lib/create-expert-toml.ts +++ b/apps/create-expert/src/lib/create-expert-toml.ts @@ -22,11 +22,20 @@ You are the coordinator for creating high-quality Perstack Experts. You delegate - \`report-generator\`: Produces the final creation report ## Context Passing -Include relevant context when delegating: -- Pass original requirements to property-extractor -- Pass extracted properties to ecosystem-builder -- Pass ecosystem info and properties to integration-manager -- Pass all accumulated context to report-generator + +Delegates only receive the query - no shared state. Include all needed context inline: + +**To property-extractor:** +Include the original user requirements in the query. + +**To ecosystem-builder:** +Include extracted properties and original requirements in the query. + +**To integration-manager:** +Include ecosystem info (expert names) and properties in the query. + +**To report-generator:** +Include all accumulated context: requirements, properties, ecosystem info, and test results. ## Quality Standards - The ecosystem should be immediately usable by fresh users @@ -438,11 +447,13 @@ Reason: [why it passed/failed] const REPORT_GENERATOR_INSTRUCTION = `You generate the final Expert creation report. -## Input -- Original requirements -- Extracted properties -- Test results from all stages (including usability) -- Expert ecosystem information +## Input (provided in your query) + +The coordinator passes all context in the query: +- Original requirements: What the user asked for +- Extracted properties: From property-extractor output +- Ecosystem info: Expert names and structure +- Test results: From integration-manager output ## Output A comprehensive report: From 7281c4d78663b522d96fc07256ce48573d7b0467 Mon Sep 17 00:00:00 2001 From: HiranoMasaaki Date: Sat, 3 Jan 2026 07:40:07 +0000 Subject: [PATCH 2/2] chore: add changeset for #382 --- .changeset/refactor-382-context-passing.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/refactor-382-context-passing.md diff --git a/.changeset/refactor-382-context-passing.md b/.changeset/refactor-382-context-passing.md new file mode 100644 index 00000000..67f83c7a --- /dev/null +++ b/.changeset/refactor-382-context-passing.md @@ -0,0 +1,6 @@ +--- +"create-expert": patch +--- + +Clarify context passing mechanism between delegates +